seqeron 0.18.0
Loading...
Searching...
No Matches
Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork > Class Template Referencesealed

Leader-only request/reply work tracked across a failover. Every replica feeds it the same clusterSeqNo-ordered stream, so all replicas hold the same outstanding set.

More...

Public Member Functions

delegate bool Dispatcher (TKey key, TWork work)
 Takes one request; must not call back into the tracker.
 
void OnRequest (TKey key, TWork work)
 A request seen on the sequenced stream, on every replica. Idempotent on the key, keeping its position.
 
void OnReply (TKey key)
 Its sequenced reply, on every replica: the request is answered.
 
void OnNotLeader ()
 The leader gate closed: forget what this node dispatched, so the next opening re-dispatches it.
 
void OnReplyNotEmitted (TKey key)
 The reply offer failed, so no sequenced reply will come. The request stays outstanding.
 
int DispatchUndispatched (Dispatcher dispatcher)
 Leader only, while the gate is open. Offers each undispatched outstanding request in request order.
 
bool IsDispatched (TKey key)
 Whether this request has been dispatched and not yet completed.
 

Properties

int Count [get]
 Requests held, dispatched or not.
 

Detailed Description

Leader-only request/reply work tracked across a failover. Every replica feeds it the same clusterSeqNo-ordered stream, so all replicas hold the same outstanding set.

  • Outstanding is replicated: a request is outstanding from its sequenced request (OnRequest) until its sequenced reply (OnReply).
  • Dispatched is local: "this node is handling it", cleared by OnNotLeader and OnReplyNotEmitted. Only the leader dispatches.

Emission is at-least-once: a reply lost in an election is dispatched again by the next leader. Key on the request's clusterSeqNo and make the reply a pure function of the request, so a re-emission is identical to the one it may duplicate and consumers can drop it.

Dispatch runs in request order, which is clusterSeqNo order, so emission order is the same on every replica. OutstandingWork.java and app/OutstandingWork.hpp are its twins; keep the three in step.

Template Parameters
TKeythe request key
TWorkthe work a dispatch needs

Member Function Documentation

◆ Dispatcher()

delegate bool Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork >.Dispatcher ( TKey  key,
TWork  work 
)

Takes one request; must not call back into the tracker.

Parameters
keythe request's key
workwhat dispatching it needs
Returns
true if taken, false to stop the sweep (no capacity); the rest wait for the next call

◆ DispatchUndispatched()

int Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork >.DispatchUndispatched ( Dispatcher  dispatcher)
inline

Leader only, while the gate is open. Offers each undispatched outstanding request in request order.

Parameters
dispatchertakes each request
Returns
how many were dispatched by this call

◆ IsDispatched()

bool Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork >.IsDispatched ( TKey  key)
inline

Whether this request has been dispatched and not yet completed.

Parameters
keythe request's key

◆ OnNotLeader()

void Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork >.OnNotLeader ( )
inline

The leader gate closed: forget what this node dispatched, so the next opening re-dispatches it.

◆ OnReply()

void Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork >.OnReply ( TKey  key)
inline

Its sequenced reply, on every replica: the request is answered.

Parameters
keythe request's key

◆ OnReplyNotEmitted()

void Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork >.OnReplyNotEmitted ( TKey  key)
inline

The reply offer failed, so no sequenced reply will come. The request stays outstanding.

Parameters
keythe request's key

◆ OnRequest()

void Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork >.OnRequest ( TKey  key,
TWork  work 
)
inline

A request seen on the sequenced stream, on every replica. Idempotent on the key, keeping its position.

Parameters
keythe request's key
workwhat dispatching it needs

Property Documentation

◆ Count

int Org.Limitless.Seqeron.App.OutstandingWork< TKey, TWork >.Count
get

Requests held, dispatched or not.


The documentation for this class was generated from the following file: