shackle (shackle v0.7.1)

View Source

Summary

Types

cast/0

-type cast() ::
          #cast{client :: shackle:client(),
                pid :: undefined | pid(),
                request_id :: shackle:request_id(),
                timeout :: timeout(),
                timestamp :: erlang:timestamp()}.

client/0

-type client() :: module().

external_request_id/0

-type external_request_id() :: term().

inet_address/0

-type inet_address() :: inet:ip_address() | inet:hostname().

inet_port/0

-type inet_port() :: inet:port_number().

protocol/0

-type protocol() :: shackle_ssl | shackle_tcp | shackle_udp.

request_id/0

-type request_id() :: {shackle_server:name(), reference()}.

response/0

-type response() :: {external_request_id(), term()}.

socket/0

-type socket() :: inet:socket() | ssl:sslsocket().

socket_option/0

-type socket_option() :: gen_tcp:connect_option() | gen_udp:option() | ssl:tls_client_option().

socket_options/0

-type socket_options() :: [socket_option()].

table/0

-type table() :: atom().

time/0

-type time() :: pos_integer().

Functions

call(PoolName, Request)

-spec call(shackle_pool:name(), term()) -> term() | {error, term()}.

call(PoolName, Request, Timeout)

-spec call(atom(), term(), timeout()) -> term() | {error, atom()}.

cast(PoolName, Request)

-spec cast(shackle_pool:name(), term()) -> {ok, request_id()} | {error, atom()}.

cast(PoolName, Request, Pid)

-spec cast(shackle_pool:name(), term(), undefined | pid()) -> {ok, request_id()} | {error, atom()}.

cast(PoolName, Request, Pid, Timeout)

-spec cast(shackle_pool:name(), term(), undefined | pid(), timeout()) ->
              {ok, request_id()} | {error, atom()}.

receive_response(RequestId)

-spec receive_response(request_id()) -> term() | {error, term()}.