Remotes an event log syncs with (Effect's eventlog/EventLogRemote).
A remote sends the journal's new entries with write and streams the
entries others wrote with changes. make_encrypted and
make_unencrypted are remotes over the EventLogRemoteRpcs of an
EventLogRemoteClient; they authenticate each identity once (again
after a Forbidden) and register with the log's Registry.
Re-exports#
Values#
| Attribute | Type | Description |
|---|---|---|
layer_client | Layer[EventLogRemoteClient, Never, ClientProtocol] |
|
make_encrypted | Effect[EventLogRemoteService, EventLogRemoteError, Scope | EventLogRemoteClient | EventLogEncryption | Registry] | A remote sending entries encrypted with the |
make_unencrypted | Effect[EventLogRemoteService, EventLogRemoteError, Scope | EventLogRemoteClient | Registry] | A remote sending plain entries (to an unencrypted server). |
layer_encrypted | Layer[EventLogRemote, EventLogRemoteError, ClientProtocol | Registry] | An encrypted remote over the |
layer_unencrypted | Layer[EventLogRemote, EventLogRemoteError, ClientProtocol | Registry] | An unencrypted remote over the |
Types#
| Type | Definition | Description |
|---|---|---|
EncodeWrite | type EncodeWrite = Callable[[IdentityService, StoreId, Sequence[Entry]], Effect[bytes, SchemaError]] | |
DecodeChanges | type DecodeChanges = Callable[[IdentityService, StoreId, bytes, EntriesById | None], Effect[Sequence[RemoteEntry], SchemaError | EventJournalError]] | |
MakeCompaction | type MakeCompaction = Callable[[RemoteSession, EventLogRemoteRpcs], EventLogRemoteCompaction | None] |
Classes#
Functions#
make_with#
make_with(encode_write, decode_changes) -> Effect[EventLogRemoteService, EventLogRemoteError, Scope | EventLogRemoteClient | Registry]A remote over the EventLogRemoteClient writing entries encoded
by encode_write and decoding changes with decode_changes,
registered with the Registry until the scope closes.
| Parameter | Type | Description |
|---|---|---|
encode_write | EncodeWrite | |
decode_changes | DecodeChanges |
Returns Effect[EventLogRemoteService, EventLogRemoteError, Scope | EventLogRemoteClient | Registry]
def make_with(
encode_write: EncodeWrite, decode_changes: DecodeChanges
) -> Effect[EventLogRemoteService, EventLogRemoteError, Scope | EventLogRemoteClient | Registry]:
"""A remote over the ``EventLogRemoteClient`` writing entries encoded
by ``encode_write`` and decoding changes with ``decode_changes``,
registered with the ``Registry`` until the scope closes."""
return _make_remote(encode_write, decode_changes, None)make_encrypted_with#
make_encrypted_with(*, compaction=True) -> Effect[EventLogRemoteService, EventLogRemoteError, Scope | EventLogRemoteClient | EventLogEncryption | Registry]A remote sending entries encrypted with the EventLogEncryption.
It has a compaction member when the server advertises compaction and
the RPC client includes EventLogCompactionRpcs, unless built with
compaction=False; without one this client never calls the
compaction RPCs.
| Parameter | Type | Description |
|---|---|---|
compaction | bool = True |
Returns Effect[EventLogRemoteService, EventLogRemoteError, Scope | EventLogRemoteClient | EventLogEncryption | Registry]
def make_encrypted_with(
*, compaction: bool = True
) -> Effect[
EventLogRemoteService,
EventLogRemoteError,
Scope | EventLogRemoteClient | EventLogEncryption | Registry,
]:
"""A remote sending entries encrypted with the ``EventLogEncryption``.
It has a ``compaction`` member when the server advertises compaction and
the RPC client includes ``EventLogCompactionRpcs``, unless built with
``compaction=False``; without one this client never calls the
compaction RPCs."""
return gen(lambda: _encrypted(compaction))layer_encrypted_with#
layer_encrypted_with(*, compaction=True) -> Layer[EventLogRemote, EventLogRemoteError, ClientProtocol | Registry]An encrypted remote over the ClientProtocol; compaction=False
leaves it without its compaction member, so this client never calls
the compaction RPCs.
| Parameter | Type | Description |
|---|---|---|
compaction | bool = True |
Returns Layer[EventLogRemote, EventLogRemoteError, ClientProtocol | Registry]
def layer_encrypted_with(
*, compaction: bool = True
) -> Layer[EventLogRemote, EventLogRemoteError, ClientProtocol | Registry]:
"""An encrypted remote over the ``ClientProtocol``; ``compaction=False``
leaves it without its ``compaction`` member, so this client never calls
the compaction RPCs."""
return (
layer_effect(EventLogRemote, make_encrypted_with(compaction=compaction))
.pipe(layer_provide(layer_client))
.pipe(layer_provide(layer_subtle))
)