pub struct BroadcastSignalRequest<T: BroadcastSignalRequestState> { /* private fields */ }Expand description
Request to broadcast a signal across the cluster
A signal can trigger multiple catching signal events in different process instances. Signal events are matched by name and tenant ID if multi-tenancy is enabled.
§Examples
ⓘ
client
.broadcast_signal()
.with_signal_name(String::from("Hello_Signal"))
.send()
.await?;Implementations§
Source§impl BroadcastSignalRequest<Initial>
impl BroadcastSignalRequest<Initial>
Sourcepub fn with_signal_name(
self,
signal_name: String,
) -> BroadcastSignalRequest<WithName>
pub fn with_signal_name( self, signal_name: String, ) -> BroadcastSignalRequest<WithName>
Source§impl BroadcastSignalRequest<WithName>
impl BroadcastSignalRequest<WithName>
Sourcepub fn with_variables<T: Serialize>(self, data: T) -> Result<Self, ClientError>
pub fn with_variables<T: Serialize>(self, data: T) -> Result<Self, ClientError>
Sets variables that will be available to all triggered signal events
§Arguments
data- Variables as serializable type that will be converted to JSON
§Returns
A Result containing the updated BroadcastSignalRequest or a ClientError
§Notes
Must be a JSON object, e.g. { "a": 1, "b": 2 }. Arrays like [1, 2] are not valid.
Sourcepub fn with_tenant_id(self, tenant_id: String) -> Self
pub fn with_tenant_id(self, tenant_id: String) -> Self
Sourcepub async fn send(self) -> Result<BroadcastSignalResponse, ClientError>
pub async fn send(self) -> Result<BroadcastSignalResponse, ClientError>
Trait Implementations§
Source§impl<T: Clone + BroadcastSignalRequestState> Clone for BroadcastSignalRequest<T>
impl<T: Clone + BroadcastSignalRequestState> Clone for BroadcastSignalRequest<T>
Source§fn clone(&self) -> BroadcastSignalRequest<T>
fn clone(&self) -> BroadcastSignalRequest<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for BroadcastSignalRequest<T>
impl<T> !RefUnwindSafe for BroadcastSignalRequest<T>
impl<T> Send for BroadcastSignalRequest<T>where
T: Send,
impl<T> Sync for BroadcastSignalRequest<T>where
T: Sync,
impl<T> Unpin for BroadcastSignalRequest<T>where
T: Unpin,
impl<T> !UnwindSafe for BroadcastSignalRequest<T>
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T in a tonic::Request