memcachir v0.1.0 Memcachir.Worker
Example
{ :ok, pid } = Memcachir.Worker.start_link()
{ :ok } = Memcachir.Worker.set(pid, "hello", "world")
{ :ok, "world" } = Memcachir.Worker.get(pid, "hello")
Coder
Memcachir.Coder
allows you to specify how the value should be encoded before
sending it to the server and how it should be decoded after it is
retrived. There are four built-in coders namely Memcachir.Coder.Raw
,
Memcachir.Coder.Erlang
, Memcachir.Coder.JSON
,
Memcachir.Coder.ZIP
. Custom coders can be created by implementing
the Memcachir.Coder
behaviour.
Summary
Functions
Creates a connection using Memcachir.Connection.start_link/2
Functions
Specs
start_link(Keyword.t) :: GenServer.on_start
Creates a connection using Memcachir.Connection.start_link/2
Connection Options
This is a superset of the connection options accepted by the
Memcachir.Connection.start_link/2
. The following list specifies the
additional options.
:ttl
- (integer) a default expiration time in seconds. This value will be used if the:ttl
value is not specified for a operation. Defaults to0
(means forever).:namespace
- (string) prepend each key with the given value.:coder
- (module | {module, options}) Can be either a module or tuple contains the module and options. Defaults to{Memcachir.Coder.Raw, []}
.