How runners talk to each other (Effect's Runners): ping a runner,
send it a message, tell it a persisted message is waiting, and deliver to
this runner's entities through storage.
make completes a RunnersTransport with local delivery;
layer_noop serves a single runner, and layer_rpc speaks the
Rpcs protocol to other runners through an RpcClientProtocol.
Values#
| Attribute | Type | Description |
|---|---|---|
layer_noop | Layer[Runners, Never, ShardingConfig | MessageStorage] |
|
make_noop | Effect[RunnersService, Never, MessageStorage | Generator | ShardingConfig | Scope] | Runners that deliver locally only. |
ReplyEncodedSchema | Codec[WithExitEncoded | ChunkEncoded | bytes, Any, Never, Never] | A reply already encoded by the protocol's codec (Effect's
|
layer_rpc | Layer[Runners, Never, MessageStorage | RpcClientProtocol | ShardingConfig] |
|
make_rpc_client | Effect[Rpcs, Never, ClientProtocol | Scope] | A client of |
make_rpc_runners | Effect[RunnersService, Never, Scope | RpcClientProtocol | MessageStorage | Generator | ShardingConfig] | Runners over RPC through the |
Types#
| Type | Definition | Description |
|---|---|---|
LocalSendError | type LocalSendError = EntityNotAssignedToRunner | MailboxFull | AlreadyProcessingMessage | How delivering to a local entity fails. |
NotifyLocalFn | type NotifyLocalFn = Callable[[IncomingLocal], Effect[None, EntityNotAssignedToRunner]] | |
SendError | type SendError = EntityNotAssignedToRunner | RunnerUnavailable | MailboxFull | AlreadyProcessingMessage | PersistenceError | How sending to a runner fails. |
SendLocalFn | type SendLocalFn = Callable[[IncomingLocal], Effect[None, LocalSendError]] |
Classes#
Functions#
make#
make(transport) -> Effect[RunnersService, Never, MessageStorage | Generator | ShardingConfig | Scope]A Runners service sending remotely through transport and
delivering locally through storage (Effect's Runners.make).
| Parameter | Type | Description |
|---|---|---|
transport | RunnersTransport |
Returns Effect[RunnersService, Never, MessageStorage | Generator | ShardingConfig | Scope]
def make(
transport: RunnersTransport,
) -> Effect[RunnersService, Never, MessageStorage | Generator | ShardingConfig | Scope]:
"""A ``Runners`` service sending remotely through ``transport`` and
delivering locally through storage (Effect's ``Runners.make``)."""
@gen
def run():
storage = yield from MessageStorage()
scope = yield from Scope()
snowflakes = yield from Generator()
config = yield from ShardingConfig()
runners = _LocalRunners(transport, storage, scope, snowflakes)
yield from runners._start(config.entity_reply_poll_interval)
return cast("RunnersService", runners)
return run