Struct GCMessagePublisher
pub struct GCMessagePublisher {
datapoint_mapping: Arc<RwLock<DatapointMapping>>,
concurrent_dispatcher_channel: Sender<GCArc<GCDatapointValue>>,
is_channel_blocking: bool,
}Expand description
Message publisher used to publish messages to the broker.
Fields§
§datapoint_mapping: Arc<RwLock<DatapointMapping>>§concurrent_dispatcher_channel: Sender<GCArc<GCDatapointValue>>§is_channel_blocking: boolImplementations§
§impl GCMessagePublisher
impl GCMessagePublisher
pub fn new( datapoint_mapping: Arc<RwLock<DatapointMapping>>, concurrent_dispatcher: Sender<GCArc<GCDatapointValue>>, is_channel_default_blocking: bool, ) -> Self
fn send_sequential( &self, data_value: GCArc<GCDatapointValue>, datapoint_entry: &DatapointEntry, ) -> bool
fn send_concurrent_block(&self, data_value: GCArc<GCDatapointValue>) -> bool
fn send_concurrent_non_block(&self, data_value: GCArc<GCDatapointValue>) -> bool
fn send_concurrent( &self, data_value: GCArc<GCDatapointValue>, entry: &DatapointEntry, ) -> bool
fn transform_data_value( &self, data_value: &GCDatapointValue, transformation: &ScaleTransformation, ) -> GCArc<GCDatapointValue>
pub fn publish_datapoint_value(&self, data_value: &GCDatapointValue) -> bool
pub fn publish_datapoint_value(&self, data_value: &GCDatapointValue) -> bool
Publishes a datapoint value to the subscribers. This method may block if the datapoint was registered as a sequentially subscriber. If register_concurrent_subscriber was used for the datapoint, the message will be sent concurrently. If register_sequential_subscriber was used for the datapoint, the message will be sent sequentially. If a datapoint is registered sequentially and concurrently, 2 messages will be sent.
§Remarks
This function will return true even if the message was not sent to some subscribers. False is only return whenever there is an error sending the message to the concurrent dispatcher or if the datapoint id is invalid.
pub fn publish_scaled_datapoint_value(
&self,
data_value: GCArc<GCDatapointValue>,
) -> bool
pub fn publish_scaled_datapoint_value( &self, data_value: GCArc<GCDatapointValue>, ) -> bool
Publishes a datapoint value to the subscribers. In contrary to publish_datapoint_value, this method will not apply any scaling transformations.
This method may block if the datapoint was registered as a sequentially subscriber. If register_concurrent_subscriber was used for the datapoint, the message will be sent concurrently. If register_sequential_subscriber was used for the datapoint, the message will be sent sequentially. If a datapoint is registered sequentially and concurrently, 2 messages will be sent.
§Remarks
This function will return true even if the message was not sent to some subscribers. False is only return whenever there is an error sending the message to the concurrent dispatcher or if the datapoint id is invalid.
Trait Implementations§
§impl Clone for GCMessagePublisher
impl Clone for GCMessagePublisher
§fn clone(&self) -> GCMessagePublisher
fn clone(&self) -> GCMessagePublisher
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more