trait SequencerClientSend extends AnyRef
- Alphabetic
- By Inheritance
- SequencerClientSend
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- implicit abstract def executionContext: ExecutionContext
- Attributes
- protected
- abstract def generateMaxSequencingTime: CantonTimestamp
Provides a value for max-sequencing-time to use for
sendAsync
if no better application provided timeout is available.Provides a value for max-sequencing-time to use for
sendAsync
if no better application provided timeout is available. Is currently a configurable offset from our clock. - abstract def sendAsync(batch: Batch[DefaultOpenEnvelope], topologyTimestamp: Option[CantonTimestamp] = None, maxSequencingTime: CantonTimestamp = generateMaxSequencingTime, messageId: MessageId = generateMessageId, aggregationRule: Option[AggregationRule] = None, callback: SendCallback = SendCallback.empty, amplify: Boolean = false)(implicit traceContext: TraceContext, metricsContext: MetricsContext): SendAsyncResult
Sends a request to sequence a deliver event to the sequencer.
Sends a request to sequence a deliver event to the sequencer. If we fail to make the request to the sequencer and are certain that it was not received by the sequencer an error is returned. In this circumstance it is safe for the caller to retry the request without causing a duplicate request. A successful response however does not mean that the request will be successfully sequenced. Instead the caller must subscribe to the sequencer and can observe one of the following outcomes:
- A deliver event is sequenced with a messageId matching this send.
- A deliver error is sequenced with a messageId matching this send.
- The sequencing time progresses beyond the provided max-sequencing-time. The caller can
assume that the send will now never be sequenced. Callers should be aware that a
message-id can be reused once one of these outcomes is observed so cannot assume that an
event with a matching message-id at any point in the future matches their send. Use the
sendTracker
to aid tracking timeouts for events (if useful this could be enriched in the future to provide send completion callbacks alongside the existing timeout notifications). For convenience callers can provide a callback that the SendTracker will invoke when the outcome of the send is known. However this convenience comes with significant limitations that a caller must understand:- the callback has no ability to be persisted so will be lost after a restart or recreation of the SequencerClient
- the callback is called by the send tracker while handling an event from a SequencerSubscription. If the callback returns an error this will be returned to the underlying subscription handler and shutdown the sequencer client. If handlers do not want to halt the sequencer subscription errors should be appropriately handled (particularly logged) and a successful value returned from the callback.
- If witnessing an event causes many prior sends to timeout there is no guaranteed order in which the callbacks of these sends will be notified.
- If replay is enabled, the callback will be called immediately with a fake
SendResult
. - When the send tracker is closed, the callback will be called immediately with AbortedDueToShutdown.
- the closing of objects should not synchronize with the completion of the callback via performUnlessClosing unless the synchronized object is responsible for closing the sequencer client itself (possibly transitively). Otherwise shutdown deadlocks are to be expected between the synchronized object and the send tracker or sequencer client. For more robust send result tracking callers should persist metadata about the send they will make and monitor the sequenced events when read, so actions can be taken even if in-memory state is lost.
- amplify
Amplification sends the submission request to multiple sequencers according to the com.digitalasset.canton.sequencing.SubmissionRequestAmplification configured in the com.digitalasset.canton.sequencing.SequencerConnections. If the sequencer client plans to send the submission request to multiple sequencers, it adds a suitable com.digitalasset.canton.sequencing.protocol.AggregationRule to the request for deduplication, unless one is already present. False disables amplificaton for this request independent of the configuration.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def generateMessageId: MessageId
Generates a message id.
Generates a message id. The message id is only for correlation within this client and does not need to be globally unique.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def send(batch: Batch[DefaultOpenEnvelope], topologyTimestamp: Option[CantonTimestamp] = None, maxSequencingTime: CantonTimestamp = generateMaxSequencingTime, messageId: MessageId = generateMessageId, aggregationRule: Option[AggregationRule] = None, callback: SendCallback = SendCallback.empty, amplify: Boolean = false)(implicit traceContext: TraceContext, metricsContext: MetricsContext): EitherT[FutureUnlessShutdown, SendAsyncClientError, Unit]
Flattened version of sendAsync
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])