Struct ockam_node::WorkerBuilder
source · pub struct WorkerBuilder<W> { /* private fields */ }
Expand description
Start a Worker
with a custom IncomingAccessControl
and OutgoingAccessControl
configuration
Any incoming messages for the worker will first be subject to the
configured AccessControl
before it is passed on to
Worker::handle_message
.
The Context::start_worker()
function wraps this type and
simply calls WorkerBuilder::with_inherited_access_control()
.
Varying use-cases should use the builder API to customise the underlying worker that is created.
Implementations§
source§impl<M, W> WorkerBuilder<W>where
M: Message + Send + 'static,
W: Worker<Context = Context, Message = M>,
impl<M, W> WorkerBuilder<W>where
M: Message + Send + 'static,
W: Worker<Context = Context, Message = M>,
sourcepub fn with_access_control(
incoming_access_control: Arc<dyn IncomingAccessControl>,
outgoing_access_control: Arc<dyn OutgoingAccessControl>,
address: impl Into<Address>,
worker: W
) -> Self
pub fn with_access_control(
incoming_access_control: Arc<dyn IncomingAccessControl>,
outgoing_access_control: Arc<dyn OutgoingAccessControl>,
address: impl Into<Address>,
worker: W
) -> Self
Create a worker which uses the given access control
sourcepub fn with_mailboxes(mailboxes: Mailboxes, worker: W) -> Self
pub fn with_mailboxes(mailboxes: Mailboxes, worker: W) -> Self
Create a worker which uses the access control from the given
Mailboxes