pub struct Reactor { /* private fields */ }Expand description
ChangeListener -> InvalidationEngine -> Query Re-execution -> SSE Push
Implementations§
Source§impl Reactor
impl Reactor
Sourcepub fn new(
node_id: NodeId,
db_pool: PgPool,
registry: FunctionRegistry,
config: ReactorConfig,
) -> Self
pub fn new( node_id: NodeId, db_pool: PgPool, registry: FunctionRegistry, config: ReactorConfig, ) -> Self
Create a new reactor.
Sourcepub fn session_server(&self) -> Arc<SessionServer>
pub fn session_server(&self) -> Arc<SessionServer>
Get the session server reference.
Sourcepub fn subscription_manager(&self) -> Arc<SubscriptionManager>
pub fn subscription_manager(&self) -> Arc<SubscriptionManager>
Get the subscription manager reference.
Sourcepub fn shutdown_receiver(&self) -> Receiver<()>
pub fn shutdown_receiver(&self) -> Receiver<()>
Get a shutdown receiver.
Sourcepub async fn register_session(
&self,
session_id: SessionId,
sender: Sender<RealtimeMessage>,
)
pub async fn register_session( &self, session_id: SessionId, sender: Sender<RealtimeMessage>, )
Register a new session.
Sourcepub async fn remove_session(&self, session_id: SessionId)
pub async fn remove_session(&self, session_id: SessionId)
Remove a session and all its subscriptions.
Sourcepub async fn subscribe(
&self,
session_id: SessionId,
client_sub_id: String,
query_name: String,
args: Value,
auth_context: AuthContext,
) -> Result<(SubscriptionId, Value)>
pub async fn subscribe( &self, session_id: SessionId, client_sub_id: String, query_name: String, args: Value, auth_context: AuthContext, ) -> Result<(SubscriptionId, Value)>
Subscribe to a query.
Sourcepub async fn unsubscribe(&self, subscription_id: SubscriptionId)
pub async fn unsubscribe(&self, subscription_id: SubscriptionId)
Unsubscribe from a query.
Sourcepub async fn subscribe_job(
&self,
session_id: SessionId,
client_sub_id: String,
job_id: Uuid,
auth_context: &AuthContext,
) -> Result<JobData>
pub async fn subscribe_job( &self, session_id: SessionId, client_sub_id: String, job_id: Uuid, auth_context: &AuthContext, ) -> Result<JobData>
Subscribe to job progress updates.
Sourcepub async fn unsubscribe_job(&self, session_id: SessionId, client_sub_id: &str)
pub async fn unsubscribe_job(&self, session_id: SessionId, client_sub_id: &str)
Unsubscribe from job updates.
Sourcepub async fn subscribe_workflow(
&self,
session_id: SessionId,
client_sub_id: String,
workflow_id: Uuid,
auth_context: &AuthContext,
) -> Result<WorkflowData>
pub async fn subscribe_workflow( &self, session_id: SessionId, client_sub_id: String, workflow_id: Uuid, auth_context: &AuthContext, ) -> Result<WorkflowData>
Subscribe to workflow progress updates.
Sourcepub async fn unsubscribe_workflow(
&self,
session_id: SessionId,
client_sub_id: &str,
)
pub async fn unsubscribe_workflow( &self, session_id: SessionId, client_sub_id: &str, )
Unsubscribe from workflow updates.
Sourcepub async fn start(&self) -> Result<()>
pub async fn start(&self) -> Result<()>
Start the reactor (runs the change listener and invalidation loop).
Sourcepub async fn stats(&self) -> ReactorStats
pub async fn stats(&self) -> ReactorStats
Get reactor statistics.
Auto Trait Implementations§
impl Freeze for Reactor
impl !RefUnwindSafe for Reactor
impl Send for Reactor
impl Sync for Reactor
impl Unpin for Reactor
impl !UnwindSafe for Reactor
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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