enum SimpleRpc::Client::Mode

Defined in:

simple_rpc/client.cr

Enum Members

ConnectPerRequest = 0

Create new connection for every request, after request done close connection. Quite slow (because spend time to create connection), but concurrency unlimited (only by OS). Good for slow requests. [default]

Pool = 1

Create persistent pool of connections. Much faster, but concurrency limited by pool_size (default = 20). Good for millions of very fast requests. Every request have one autoreconnection attempt (because connection in pool can be outdated).

Single = 2

Single persistent connection. Same as pool of size 1, you should manage concurrency by yourself. Every request have one autoreconnection attempt (because persistent connection can be outdated).

Instance Method Summary

Instance Method Detail

def connect_per_request? #

[View source]
def pool? #

[View source]
def single? #

[View source]