pub struct MessagesRpcService {
pub store: Arc<RedisMessageStorage>,
pub stream_sender: UnboundedSender<StreamMessage>,
pub response_sender: UnboundedSender<CatchUpResponse>,
pub subscription: Arc<RwLock<SubscriptionConfig>>,
pub task_handle: Arc<RwLock<Option<AbortHandle>>>,
}Fields§
§store: Arc<RedisMessageStorage>§stream_sender: UnboundedSender<StreamMessage>Channel for sending streaming messages back to the relay service
response_sender: UnboundedSender<CatchUpResponse>Channel for sending catch-up responses back to the relay service
subscription: Arc<RwLock<SubscriptionConfig>>The current subscription config
task_handle: Arc<RwLock<Option<AbortHandle>>>the running task handle for the subscription task
Implementations§
Source§impl MessagesRpcService
impl MessagesRpcService
pub fn new( store: Arc<RedisMessageStorage>, ) -> (UnboundedReceiver<StreamMessage>, UnboundedReceiver<CatchUpResponse>, Self)
async fn start_subscription_task(&self) -> Result<(), MessageStoreError>
async fn abort_subscription_task(&self) -> Result<(), MessageStoreError>
Trait Implementations§
Source§impl Clone for MessagesRpcService
impl Clone for MessagesRpcService
Source§fn clone(&self) -> MessagesRpcService
fn clone(&self) -> MessagesRpcService
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 moreSource§impl MessageService for MessagesRpcService
impl MessageService for MessagesRpcService
async fn publish( self, _context: Context, message: MessageFull, ) -> Result<PublishResult, MessageError>
Source§async fn message(
self,
_context: Context,
id: MessageId,
) -> Result<Option<MessageFull>, MessageError>
async fn message( self, _context: Context, id: MessageId, ) -> Result<Option<MessageFull>, MessageError>
Retrieve a specific message by its ID
Source§async fn user_data(
self,
_context: Context,
author: KeyId,
storage_key: StoreKey,
) -> Result<Option<MessageFull>, MessageError>
async fn user_data( self, _context: Context, author: KeyId, storage_key: StoreKey, ) -> Result<Option<MessageFull>, MessageError>
Retrieve a specific user’s data by their key and storage key
Source§async fn check_messages(
self,
_context: Context,
message_ids: Vec<MessageId>,
) -> Result<Vec<Option<String>>, MessageError>
async fn check_messages( self, _context: Context, message_ids: Vec<MessageId>, ) -> Result<Vec<Option<String>>, MessageError>
Check which messages the server already has and return their global stream IDs.
Returns a vec of
Option<String> in the same order as the input, where: Read moreSource§async fn subscribe(
self,
_context: Context,
config: SubscriptionConfig,
) -> Result<(), MessageError>
async fn subscribe( self, _context: Context, config: SubscriptionConfig, ) -> Result<(), MessageError>
Start the subscription
Source§async fn update_filters(
self,
_context: Context,
request: FilterUpdateRequest,
) -> Result<SubscriptionConfig, MessageError>
async fn update_filters( self, _context: Context, request: FilterUpdateRequest, ) -> Result<SubscriptionConfig, MessageError>
Update the running subscription filters with the actions. Returns the now final subscription config.
Source§async fn catch_up(
self,
_context: Context,
request: CatchUpRequest,
) -> Result<SubscriptionConfig, MessageError>
async fn catch_up( self, _context: Context, request: CatchUpRequest, ) -> Result<SubscriptionConfig, MessageError>
Update the internal subscription and catch up to the latest stream height for the given filter
Source§fn serve(self) -> ServeMessageService<Self>
fn serve(self) -> ServeMessageService<Self>
Returns a serving function to use with
InFlightRequest::execute.
Auto Trait Implementations§
impl Freeze for MessagesRpcService
impl !RefUnwindSafe for MessagesRpcService
impl Send for MessagesRpcService
impl Sync for MessagesRpcService
impl Unpin for MessagesRpcService
impl !UnwindSafe for MessagesRpcService
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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