pub struct Register {
pub worker_id: String,
pub key_id: String,
pub aggregates: Vec<WorkerAggregate>,
pub max_concurrency: u32,
pub event_schemas: Vec<EventSchema>,
pub protocol: u32,
pub service: String,
pub deployment: String,
}Expand description
The first message of a worker’s stream.
Fields§
§worker_id: Stringthis process, for logs and the UI
key_id: Stringthe key that answers the challenge and signs results
aggregates: Vec<WorkerAggregate>The aggregates the worker runs; at least one. The kernel registers each one: it refuses commands for an aggregate type or command type no worker registered, and is not ready while a registered aggregate has no worker connected. Replicas register the same aggregates, with the same key (or its successor, see Grant.succeeds).
max_concurrency: u32commands in flight at once; 0 counts as 1
event_schemas: Vec<EventSchema>The payload version the worker writes per event type; types not listed are written at 1. The kernel refuses a worker, or a result, that would write an older version of a type than the store already holds, and a result whose events differ from what was declared.
protocol: u32§service: StringThe service this worker belongs to; its membership (see Membership) decides whether the
kernel waits for the worker’s aggregates. Empty: no service, they are always waited for.
deployment: StringThe code version (deployment) of the process: 1 to 128 letters, digits, -, _ and .;
empty: none. Stored with every event it writes and with its snapshots (it gets only
snapshots its own deployment made). When the service’s membership names another deployment,
the worker gets no commands. With a deployment, event_schemas lists every event type the
worker knows (also those it only reads, at the version it reads), and the kernel refuses a
command (unknown_history, before the worker sees it) whose aggregate holds an event of a
schema above the declared one, or of a type it does not declare that another deployment
first wrote after this deployment’s first event. Such a worker may also declare an older
schema than the store holds (a rollback); the check above keeps it off aggregates it cannot
read.
Trait Implementations§
Source§impl Message for Register
impl Message for Register
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.impl StructuralPartialEq for Register
Auto Trait Implementations§
impl Forget for Register
impl Freeze for Registerwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<WorkerAggregate>: Freeze,
PhantomData<EventSchema>: Freeze,
impl Move for Register
impl RefUnwindSafe for Register
impl Send for Registerwhere
RawVecInner: Send,
impl Sync for Registerwhere
RawVecInner: Sync,
impl Unpin for Register
impl UnsafeUnpin for Registerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<WorkerAggregate>: UnsafeUnpin,
PhantomData<EventSchema>: UnsafeUnpin,
impl UnwindSafe for Registerwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request