pub trait PubSubSender: Debug + Send + Sync {
    // Required methods
    fn push_diff(&self, shard_id: &ShardId, diff: &VersionedData);
    fn subscribe(
        self: Arc<Self>,
        shard_id: &ShardId
    ) -> Arc<ShardSubscriptionToken>;
}
Expand description

The public send-side client to Persist PubSub.

Required Methods§

source

fn push_diff(&self, shard_id: &ShardId, diff: &VersionedData)

Push a diff to subscribers.

source

fn subscribe(self: Arc<Self>, shard_id: &ShardId) -> Arc<ShardSubscriptionToken>

Subscribe the corresponding PubSubReceiver to diffs for the given shard.

Returns a token that, when dropped, will unsubscribe the client from the shard.

If the client is already subscribed to the shard, repeated calls will make no further calls to the server and instead return clones of the Arc<ShardSubscriptionToken>.

Implementors§