Interface IOccurrences
- Namespace
- Cratis.Chronicle.Occurrences
- Assembly
- Cratis.Chronicle.dll
Provides namespace-bound occurrence effect receipts.
public interface IOccurrences
- Extension Methods
Methods
EndActivation(ActivationId)
Explicitly ends a logical activation, recording Shutdown once. Stopping one instance never calls this implicitly.
Task EndActivation(ActivationId activationId)
Parameters
activationIdActivationIdThe activation to end, shared across all instances.
Returns
- Task
The durable recording work.
Exceptions
- OccurrencesNotSupported
Occurrence support is absent or unknown.
GetEffectReceipt(EffectKey)
Looks up the first durable outcome without executing the effect again.
Task<EffectReceipt?> GetEffectReceipt(EffectKey key)
Parameters
keyEffectKeyThe effect key.
Returns
- Task<EffectReceipt>
The stored receipt, or null if none exists.
Exceptions
- EffectReceiptsNotSupported
Receipt support is absent or unknown.
Record(object, string)
Records an application trigger in this namespace. This is an in-process API, not a public trigger endpoint.
Task<OccurrenceRecordResult> Record(object trigger, string idempotencyId)
Parameters
triggerobjectThe discovered typed plaintext payload, without personal data.
idempotencyIdstringA stable identity for this ingress, reused on retries.
Returns
- Task<OccurrenceRecordResult>
The durable ingress outcome, including identity conflicts and invalid payloads.
Exceptions
- OccurrencesNotSupported
Occurrence support is absent or unknown.
- TriggerNotValid
The trigger has not been discovered.
RecordEffectReceipt(EffectKey, EffectOutcome, JsonNode?)
Records a terminal refusal or a successful effect without events or protected reads.
Task<EffectReceiptResult> RecordEffectReceipt(EffectKey key, EffectOutcome outcome, JsonNode? response = null)
Parameters
keyEffectKeyThe effect key.
outcomeEffectOutcomeNoEvents or Refused. Appended is only written through a unit of work.
responseJsonNodeOptional plaintext JSON response, without personal data.
Returns
- Task<EffectReceiptResult>
The first durable receipt, including its winning response.
Exceptions
- EffectReceiptsNotSupported
Receipt support is absent or unknown.
- EffectReceiptResponseTooLarge
The response exceeds 64 KiB of UTF-8 JSON.
- EffectReceiptNotValid
The key or outcome is invalid.