The cluster session a producer submits on, with the method names and semantics of ClusterStreamSender.java and sequencer/client/ClusterStreamSender.hpp. Small, because Aeron.NET's AeronCluster already is the cluster protocol the C++ class implements by hand; this adds only ConnectColocated, a Send that spins through back-pressure and elections, and a self-throttling KeepAlive.
More...
|
| | ClusterStreamSender () |
| | A sender with no session; ConnectColocated or Connect opens one.
|
| |
| | ClusterStreamSender (IIdleStrategy idle) |
| | The same, waiting on idle wherever it blocks: the Send spin and a session's connect.
|
| |
| void | Connect (Aeron aeron, string egressChannel, string ingressEndpoints, IEgressListener appListener=null) |
| | Connects a client co-located with no member: UDP ingress against the whole endpoint set.
|
| |
| void | ConnectColocated (Aeron aeron, int memberId, long ipcConnectTimeoutMs, string egressChannel, string ingressEndpoints, IEgressListener appListener=null) |
| | Connects a client sharing a cluster member's Aeron directory: that member's aeron:ipc first, within the short ipcConnectTimeoutMs since a follower never answers there, then UDP. If leadership later moves away, PollEgress reconnects over UDP, a step per call; moving back is not chased.
|
| |
| bool | Reconnect () |
| | Replaces a lost session with a new one, opened as the first was but one step per call, so the caller's duty cycle never waits on an unreachable cluster. What the old one had not committed is not carried over: the caller's tracker decides what to do about it.
|
| |
| void | SetIngressHold (IIngressTracker hold) |
| | Hears every NewLeader, and gives up a send that met one while it holds.
|
| |
| bool | Send (IDirectBuffer frame, int length) |
| | Offers one pre-encoded frame to cluster ingress, spinning until it lands. CLOSED is not terminal: once it sees the leader's egress end, AeronCluster closes the ingress publication and waits for a NewLeader, which PollEgress installs — hence the spin polls. A leader that dies ends no egress, so its publication takes frames until the NewLeader, which discards what it has not sent: a frame that lands can still be lost, and only the queue confirms it (doc/fault-tolerance.md §1.2). Bounded, since losing quorum would otherwise stop the caller's duty cycle. No keep-alive from in here: it would offer on the same stuck publication.
|
| |
| void | KeepAlive () |
| | Sends a keep-alive if the interval has elapsed; call it every duty-cycle iteration.
|
| |
| int | PollEgress () |
| | Drains cluster egress, then applies any reconnect it called for, outside the poll.
|
| |
| void | Dispose () |
| | Closes the session, and any attempt to replace it. The Aeron client is the caller's and is left open.
|
| |
The cluster session a producer submits on, with the method names and semantics of ClusterStreamSender.java and sequencer/client/ClusterStreamSender.hpp. Small, because Aeron.NET's AeronCluster already is the cluster protocol the C++ class implements by hand; this adds only ConnectColocated, a Send that spins through back-pressure and elections, and a self-throttling KeepAlive.
As in Java, when leadership moves off the co-located member this reconnects (a new cluster session id) where C++ swaps the publication, because AeronCluster owns its publication.
Every timeout Java sets is set here explicitly: Aeron.NET's defaults are Aeron's, and its new-leader timeout is shorter than an election.
Not thread-safe: every method belongs to the caller's one duty-cycle thread.
| bool Org.Limitless.Seqeron.Sequencer.Client.ClusterStreamSender.Send |
( |
IDirectBuffer |
frame, |
|
|
int |
length |
|
) |
| |
|
inline |
Offers one pre-encoded frame to cluster ingress, spinning until it lands. CLOSED is not terminal: once it sees the leader's egress end, AeronCluster closes the ingress publication and waits for a NewLeader, which PollEgress installs — hence the spin polls. A leader that dies ends no egress, so its publication takes frames until the NewLeader, which discards what it has not sent: a frame that lands can still be lost, and only the queue confirms it (doc/fault-tolerance.md §1.2). Bounded, since losing quorum would otherwise stop the caller's duty cycle. No keep-alive from in here: it would offer on the same stuck publication.
- Parameters
-
| frame | the frame, from offset 0 |
| length | its length in bytes |
- Returns
- false when there is no session left to take it, or when a
NewLeader arrived mid-spin while the IIngressTracker holds: nothing was placed, and the frame goes again once it releases
Implements Org.Limitless.Seqeron.Sequencer.Client.IIngressSender.