seqeron 0.18.0
Loading...
Searching...
No Matches
org::limitless::seqeron::app::OutstandingWork< Work, Key > Class Template Reference

#include <org/limitless/seqeron/app/OutstandingWork.hpp>

Public Member Functions

void onRequest (const Key &key, Work work)
 Records a request seen on the sequenced stream, on every replica.
 
void onReply (const Key &key)
 Records a request's sequenced reply, on every replica: the request is answered.
 
void onNotLeader ()
 
void onReplyNotEmitted (const Key &key)
 Records that a reply offer failed, so no sequenced reply will come.
 
template<typename DispatchFn >
int dispatchUndispatched (DispatchFn &&dispatch)
 Offers each undispatched outstanding request, in request order.
 
std::size_t size () const noexcept
 
bool isDispatched (const Key &key) const
 

Member Function Documentation

◆ dispatchUndispatched()

template<typename Work , typename Key = std::int64_t>
template<typename DispatchFn >
int org::limitless::seqeron::app::OutstandingWork< Work, Key >::dispatchUndispatched ( DispatchFn &&  dispatch)
inline

Offers each undispatched outstanding request, in request order.

Leader only, while the gate is open.

Parameters
dispatchcalled as dispatch(key, work); returns false to stop the sweep, and must not call back into the tracker
Returns
how many were dispatched by this call

◆ isDispatched()

template<typename Work , typename Key = std::int64_t>
bool org::limitless::seqeron::app::OutstandingWork< Work, Key >::isDispatched ( const Key &  key) const
inline

◆ onNotLeader()

template<typename Work , typename Key = std::int64_t>
void org::limitless::seqeron::app::OutstandingWork< Work, Key >::onNotLeader ( )
inline

◆ onReply()

template<typename Work , typename Key = std::int64_t>
void org::limitless::seqeron::app::OutstandingWork< Work, Key >::onReply ( const Key &  key)
inline

Records a request's sequenced reply, on every replica: the request is answered.

Parameters
keythe answered request's key

◆ onReplyNotEmitted()

template<typename Work , typename Key = std::int64_t>
void org::limitless::seqeron::app::OutstandingWork< Work, Key >::onReplyNotEmitted ( const Key &  key)
inline

Records that a reply offer failed, so no sequenced reply will come.

The request stays outstanding.

Parameters
keythe request whose reply was not emitted

◆ onRequest()

template<typename Work , typename Key = std::int64_t>
void org::limitless::seqeron::app::OutstandingWork< Work, Key >::onRequest ( const Key &  key,
Work  work 
)
inline

Records a request seen on the sequenced stream, on every replica.

Idempotent on the key, keeping its position.

Parameters
keythe request's key, normally its clusterSeqNo
workwhat dispatching it takes

◆ size()

template<typename Work , typename Key = std::int64_t>
std::size_t org::limitless::seqeron::app::OutstandingWork< Work, Key >::size ( ) const
inlinenoexcept

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