Documentation
¶
Overview ¶
Write-through cache of hot Storage record reads for the Session that owns the Storage.
Ports packages/durable/src/session/cached-storage.ts
Go mapping decisions:
- The cache is read from several goroutines (the line and the off-line readers), so one mutex guards its state. It is never held across a read of the backend.
- Cached records are shared: Published keeps a copy of the written record's struct, and every read of it returns that pointer, as upstream shares the frozen object. Object.freeze has no Go counterpart; callers must not modify a record Storage returned, as with every Storage.
- `Storage.publishing` is the PublishingStorage capability. A Go method cannot be absent, so Publishing runs publish directly when the backend has no scope, which is what the Session does for a Storage without one. ScopeOf reports the backend's own scope or nil.
The newest entry and newest head marker of each recently used conversation, kept current from the Session's commits.
Ports packages/durable/src/session/conversation-tails.ts
Go mapping decisions:
- `EntryId | null | undefined` of `peek` is an explicit result: the ID and a TailState (TailUnknown for `undefined`, TailNone for `null`, TailKnown when the newest entry ID is returned).
- `read` callbacks are blocking calls that return the value or the error that failed the read. Upstream's microtask interleavings around `await read()` are the interleavings of the goroutines that call Apply while a read is out; no lock is held across `read`.
- Kept markers are shared, not copied: Object.freeze has no Go counterpart, so the immutability of entry records (`Tx.AppendEntry`) is by convention, as everywhere in this port.
The keys of the Session line: what a commit writes and a job reads, so a read of an unpublished write waits for it.
Ports packages/durable/src/session/keys.ts
Go mapping decisions:
- Upstream's `touch` returns `Promise<void> | undefined`: a gate to wait on, or nothing. Here it is a blocking call that returns when the key has no unpublished writer (at once when it never had one). The wait is not cancellable, as upstream's: a gate always opens, by a publication or by the Session's failure (Session.AwaitTouch).
- `Storage.entry`'s two overloads are Entry and VisibleEntry, as the Go Storage names them.
- Upstream's `#after` chains the read on the gate's promise; here the read runs after the blocking touch.
Package session ports the pi-durable Session kernel: one mutation line, the group-commit writer that stores what the line admits and publishes it in line order, the loaded document tracker cache, transactions, document forks, and committed publication and observation.
Ports packages/durable/src/session/session.ts
Go mapping decisions:
- Upstream's Promise chain of line jobs is a FIFO ticket queue (slot): each job waits for its predecessor's release, so jobs run in admission order, each on its caller's goroutine, one at a time. A job releases the line when its callback, settlement, and logical admission are done (it has handed its commit to the writer); it does not wait for the commit.
- Group commit (docs/group-commit.md): a commit with writes joins the writer's pending batch (Writer.Admit) and the line goes on. The writer, one goroutine it owns, sends everything admitted while no call is in flight as one Storage.Commit call, off the line, and publishes the parts of a call in line order. A job's reads wait on the gate of the newest unpublished writer of their key (Touch, AwaitTouch, GatedStorage); a gate wait blocks the job's goroutine, never the writer.
- Pi's event loop gives two guarantees that Go's scheduler does not, and the Session keeps them with an explicit handshake (resumption.go) that the waits of the Session signal, never by reading the state of goroutines, at any number of them: (1) a publication queues one dispatch to the host's observers, which runs a microtask later, before every wait the commit resolves and every abort it queues: here the publication runs the dispatch right after the part's own observers (inside the Storage's publication scope when it has one), then the work the observers deferred (DeferUntilPublished: wakes of waits, aborts), and waits until the registered waits those wakes readied have resumed (Park, Await); (2) outcomes are delivered in line order, and the continuations of what a publication resolved start before the next part of the call is published (a macrotask hop): a delivery goroutine the Session owns releases the callers in line order, waiting for each released caller to have resumed from its wait, and the writer's hop before the next part waits for that delivery goroutine to be idle. "Started" is as far as the Session can know for code that is not its own: a caller that needs its continuation ordered up to its next wait brings a Continuation (WithContinuation).
- A job's outcome is delivered in line order (the fence): a no-write job, a read, and a callback's own error wait for the outcomes before them, and a commit for its own publication. CommitInternal's jobs are exempt when they wrote nothing and waited at no gate. At most maxOutstanding admitted jobs have no outcome delivered; beyond it the line waits.
- An AbortSignal is the context's cancellation; withoutAbortSignal is context.WithoutCancel, which keeps context values. A gate wait is not cancellable, as upstream's: a gate always opens, by a publication or by the Session's failure.
The Session's writer: commits the mutation line admitted, stored in batches off the line and published in line order.
Ports packages/durable/src/session/writer.ts
Go mapping decisions:
- Upstream's async `#flush` is one goroutine the writer owns: it runs while parts are queued or in flight, ends when none are, and Wait joins it (the Session's close waits for it after the drain). `#flight` is set while it runs.
- A Part's `outcome` promise is Wait (blocking, returns the rejection as the error) and OnSettled (the callback runs on the writer's goroutine at the moment the outcome settles: the Session's outcome fences are ordered by it, not by a caller's wake-up). A part's `gate` promise is Gate, a channel closed once it is published or never will be.
- Upstream's macrotask hop between two parts is WriterHost.Hop: the Session returns from it once the goroutines the earlier publication woke (the callers of the commits it resolved, the registered waits its observers woke) have resumed, which is the Go form of "the continuations of what one part resolves start before the next is published" (see the Session header and resumption.go).
- Upstream's `Storage.publishing` scope and the microtask dispatch after it are WriterHost.Publishing: it returns once the publication ran inside the storage's scope and the host dispatch and the wakes it queued ran after it. A nil channel means it ran at once.
- A part's keys leave the unpublished set after its own observers ran (upstream unregisters first). Upstream's publication is atomic with respect to the code that reads keys; here the observers run on this goroutine while another goroutine may touch a key, so a key must stay until the state the observers keep in step with is.
Index ¶
- Constants
- Variables
- func AppendKey(id durable.ConversationId) string
- func CloseEnds(failure error) (watch, observer durable.WatchEnd)
- func Contained(callback func(), onError func(error))
- func ConversationKey(id durable.ConversationId) string
- func DocumentKey(addressId string) string
- func DocumentRetention(ms *float64) float64
- func Enter(ctx context.Context)
- func EntryKey(id durable.EntryId) string
- func IncarnationKey(id durable.DocumentId) string
- func NewObservation[T any](value T, guarded interface{ ... }) durable.Observation[T]
- func NewSessionWatch[T any](session *SessionImpl, value T, detach func()) *chord.Watch[T]
- func OwnedKey[N durable.TaskId | string](node N) string
- func PersistWithin(ms *float64) float64
- func RequestKey(conversationId durable.ConversationId, requestId string) string
- func ScopeKey(scope durable.DocumentRecordScope) string
- func ScopeOf(storage durable.Storage) func(ctx context.Context, publish func())
- func SubmissionKey(id durable.SubmissionId) string
- func TableKeys(writes []durable.StorageWrite, keys *[]string)
- func TaskKey(id durable.TaskId) string
- func Wait(ctx context.Context, done <-chan struct{}) error
- type AnyTaskRecord
- type CachedSizes
- type CachedStorage
- func (cached *CachedStorage) Close(ctx context.Context) error
- func (cached *CachedStorage) Commit(ctx context.Context, batches [][]durable.StorageWrite, ...) (durable.CommitResult, error)
- func (cached *CachedStorage) Conversation(ctx context.Context, id durable.ConversationId) (*durable.ConversationRecord, error)
- func (cached *CachedStorage) Document(ctx context.Context, id durable.DocumentId, at durable.DocumentPoint) (*durable.StoredDocument, error)
- func (cached *CachedStorage) Entry(ctx context.Context, id durable.EntryId) (*durable.EntryAt, error)
- func (cached *CachedStorage) FindDocument(ctx context.Context, address durable.DocumentAddress, at durable.DocumentPoint) (*durable.DocumentRecord, error)
- func (cached *CachedStorage) FindLatestHeadMarker(ctx context.Context, conversationId durable.ConversationId, ...) (*durable.EntryRecord, error)
- func (cached *CachedStorage) MintId() (int64, error)
- func (cached *CachedStorage) Published(writes []durable.StorageWrite)
- func (cached *CachedStorage) Publishing(ctx context.Context, publish func())
- func (cached *CachedStorage) ReadsInFlight() int
- func (cached *CachedStorage) ScanConversations(ctx context.Context, query durable.ConversationQuery, limit int, ...) (durable.Page[durable.ConversationRecord, durable.Cursor], error)
- func (cached *CachedStorage) ScanDocuments(ctx context.Context, query durable.DocumentQuery, limit int, ...) (durable.Page[durable.DocumentRecord, durable.Cursor], error)
- func (cached *CachedStorage) ScanEntries(ctx context.Context, query durable.EntryQuery, limit int, ...) (durable.Page[durable.EntryRecord, durable.Cursor], error)
- func (cached *CachedStorage) ScanSubmissions(ctx context.Context, query durable.SubmissionQuery, limit int, ...) (durable.Page[durable.SubmissionRecord, durable.Cursor], error)
- func (cached *CachedStorage) ScanTasks(ctx context.Context, query durable.TaskQuery, limit int, cursor durable.Cursor) (durable.Page[anyTaskRecord, durable.Cursor], error)
- func (cached *CachedStorage) Sizes() CachedSizes
- func (cached *CachedStorage) Submission(ctx context.Context, id durable.SubmissionId) (*durable.SubmissionRecord, error)
- func (cached *CachedStorage) SubmissionByRequest(ctx context.Context, conversationId durable.ConversationId, requestId string) (*durable.SubmissionRecord, error)
- func (cached *CachedStorage) Task(ctx context.Context, id durable.TaskId) (*anyTaskRecord, error)
- func (cached *CachedStorage) VisibleEntry(ctx context.Context, conversationId durable.ConversationId, id durable.EntryId) (*durable.EntryAt, error)
- type Continuation
- type ConversationTails
- func (tails *ConversationTails) Apply(writes []durable.StorageWrite)
- func (tails *ConversationTails) Latest(conversationId durable.ConversationId, read func() (*durable.EntryId, error)) (*durable.EntryId, error)
- func (tails *ConversationTails) Marker(conversationId durable.ConversationId, atOrBefore *durable.EntryId, ...) (*HeadMarker, error)
- func (tails *ConversationTails) Markers() int
- func (tails *ConversationTails) Peek(conversationId durable.ConversationId) (durable.EntryId, TailState)
- func (tails *ConversationTails) Size() int
- type CreateSessionOptions
- type DocumentCacheSizes
- type GatedStorage
- func (gated *GatedStorage) Close(ctx context.Context) error
- func (gated *GatedStorage) Commit(ctx context.Context, batches [][]durable.StorageWrite, ...) (durable.CommitResult, error)
- func (gated *GatedStorage) Conversation(ctx context.Context, id durable.ConversationId) (*durable.ConversationRecord, error)
- func (gated *GatedStorage) Document(ctx context.Context, id durable.DocumentId, at durable.DocumentPoint) (*durable.StoredDocument, error)
- func (gated *GatedStorage) Entry(ctx context.Context, id durable.EntryId) (*durable.EntryAt, error)
- func (gated *GatedStorage) FindDocument(ctx context.Context, address durable.DocumentAddress, at durable.DocumentPoint) (*durable.DocumentRecord, error)
- func (gated *GatedStorage) FindLatestHeadMarker(ctx context.Context, conversationId durable.ConversationId, ...) (*durable.EntryRecord, error)
- func (gated *GatedStorage) MintId() (int64, error)
- func (gated *GatedStorage) ScanConversations(ctx context.Context, query durable.ConversationQuery, limit int, ...) (durable.Page[durable.ConversationRecord, durable.Cursor], error)
- func (gated *GatedStorage) ScanDocuments(ctx context.Context, query durable.DocumentQuery, limit int, ...) (durable.Page[durable.DocumentRecord, durable.Cursor], error)
- func (gated *GatedStorage) ScanEntries(ctx context.Context, query durable.EntryQuery, limit int, ...) (durable.Page[durable.EntryRecord, durable.Cursor], error)
- func (gated *GatedStorage) ScanSubmissions(ctx context.Context, query durable.SubmissionQuery, limit int, ...) (durable.Page[durable.SubmissionRecord, durable.Cursor], error)
- func (gated *GatedStorage) ScanTasks(ctx context.Context, query durable.TaskQuery, limit int, cursor durable.Cursor) (...)
- func (gated *GatedStorage) Submission(ctx context.Context, id durable.SubmissionId) (*durable.SubmissionRecord, error)
- func (gated *GatedStorage) SubmissionByRequest(ctx context.Context, conversationId durable.ConversationId, requestId string) (*durable.SubmissionRecord, error)
- func (gated *GatedStorage) Task(ctx context.Context, id durable.TaskId) (*durable.TaskRecord[durable.JsonValue, durable.JsonValue, durable.JsonValue], ...)
- func (gated *GatedStorage) VisibleEntry(ctx context.Context, conversationId durable.ConversationId, id durable.EntryId) (*durable.EntryAt, error)
- type GuardedCommitObserver
- type GuardedObserver
- type HeadMarker
- type Hooks
- type LineDocument
- type LineSizes
- type LineTicket
- type LoadedDocument
- type ObservedCommit
- type Parked
- type Part
- type PartSpec
- type PublishFailure
- type PublishFailureKind
- type SessionImpl
- func (session *SessionImpl) AssertHealthy() error
- func (session *SessionImpl) Await(ctx context.Context, done <-chan struct{})
- func (session *SessionImpl) AwaitDeliveriesEntered(ctx context.Context) error
- func (session *SessionImpl) AwaitTouch(ctx context.Context, key string) error
- func (session *SessionImpl) Close(ctx context.Context) error
- func (session *SessionImpl) Closed() <-chan struct{}
- func (session *SessionImpl) Commit(ctx context.Context, change func(tx durable.Tx) (any, error), ...) (any, error)
- func (session *SessionImpl) CommitInternal(ctx context.Context, change func(tx *Transaction) (any, error)) (any, error)
- func (session *SessionImpl) CommitInternalWithTicket(ticket *LineTicket, ctx context.Context, ...) (any, error)
- func (session *SessionImpl) CommitSubscriptions() int
- func (session *SessionImpl) CommitWith(ctx context.Context, change func(tx *Transaction) (any, error), ...) (any, error)
- func (session *SessionImpl) CommitWithTicket(ticket *LineTicket, ctx context.Context, ...) (any, error)
- func (session *SessionImpl) ConversationDocumentOnLine(ctx context.Context, token durable.AnyDocToken, ...) (*LineDocument, error)
- func (session *SessionImpl) DeferUntilPublished(run func())
- func (session *SessionImpl) DocumentCacheSizes() DocumentCacheSizes
- func (session *SessionImpl) Drained() <-chan struct{}
- func (session *SessionImpl) End() durable.SessionEnd
- func (session *SessionImpl) Fail(ctx context.Context, err error)
- func (session *SessionImpl) Failed() <-chan struct{}
- func (session *SessionImpl) Failure() error
- func (session *SessionImpl) FollowCommits(listener func(ctx context.Context, commit ObservedCommit)) func()
- func (session *SessionImpl) GateTouches(key string) int
- func (session *SessionImpl) KnownLatestEntryId(conversationId durable.ConversationId) (id *durable.EntryId, known bool)
- func (session *SessionImpl) LatestEntryId(ctx context.Context, conversationId durable.ConversationId) (*durable.EntryId, error)
- func (session *SessionImpl) LatestHeadMarker(ctx context.Context, conversationId durable.ConversationId, ...) (*durable.EntryRecord, error)
- func (session *SessionImpl) LineJobs() int
- func (session *SessionImpl) LineSizes() LineSizes
- func (session *SessionImpl) LineStorage() durable.Storage
- func (session *SessionImpl) ObserveCommits(observer durable.CommitObserver) durable.CommitObservation
- func (session *SessionImpl) ObserveDocErased(ctx context.Context, token durable.AnyDocToken, ...) (durable.Observation[durable.JsonObject], error)
- func (session *SessionImpl) ObserverSubscriptions() int
- func (session *SessionImpl) OnJobEnd(end func())
- func (session *SessionImpl) OwnsTransaction(tx durable.Tx) (*Transaction, bool)
- func (session *SessionImpl) Park(ctx context.Context, done <-chan struct{}) *Parked
- func (session *SessionImpl) ReadOnLine(job func(storage durable.Storage) (any, error)) (any, error)
- func (session *SessionImpl) ReadOnLineCtx(ctx context.Context, job func(storage durable.Storage) (any, error)) (any, error)
- func (session *SessionImpl) ReadWithTicket(ticket *LineTicket, job func(storage durable.Storage) (any, error)) (any, error)
- func (session *SessionImpl) ReadWithTicketCtx(ticket *LineTicket, ctx context.Context, ...) (any, error)
- func (session *SessionImpl) Report(err error)
- func (session *SessionImpl) ReportAs(ctx context.Context, err error, info durable.ReportInfo)
- func (session *SessionImpl) SnapshotAsOfErased(ctx context.Context, token durable.AnyDocToken, at durable.EntryId, ...) (durable.JsonObject, error)
- func (session *SessionImpl) SnapshotErased(ctx context.Context, token durable.AnyDocToken, args ...any) (durable.JsonObject, error)
- func (session *SessionImpl) Storage() durable.Storage
- func (session *SessionImpl) SubscribeClose(listener func()) func()
- func (session *SessionImpl) TakeLineTicket() *LineTicket
- func (session *SessionImpl) Touch(key string) <-chan struct{}
- func (session *SessionImpl) UnloadDocuments() error
- func (session *SessionImpl) WaitDeliveries()
- func (session *SessionImpl) WatchDocErased(ctx context.Context, token durable.AnyDocToken, args ...any) (durable.WatchHandle[durable.JsonObject], error)
- func (session *SessionImpl) WriteAtClose(ctx context.Context, writes func() []durable.StorageWrite) error
- type TailState
- type Transaction
- func (tx *Transaction) AppendEntry(conversationId durable.ConversationId, value durable.EntryDraft) (durable.EntryRecord, error)
- func (tx *Transaction) Context() context.Context
- func (tx *Transaction) Conversation(id durable.ConversationId) (*durable.ConversationRecord, error)
- func (tx *Transaction) CreateConversation(options durable.CreateConversationOptions) (durable.ConversationRecord, error)
- func (tx *Transaction) CreateRootConversation() (durable.ConversationRecord, error)
- func (tx *Transaction) CreateSubmission(create durable.SubmissionCreate) (durable.SubmissionRecord, error)
- func (tx *Transaction) CreateTaskErased(task durable.AnyTask, input durable.JsonValue, options durable.TaskOptions) (durable.TaskId, error)
- func (tx *Transaction) CreateTaskFromSubmissions(task durable.AnyTask, input durable.JsonValue, options durable.TaskOptions, ...) (durable.TaskId, error)
- func (tx *Transaction) CreatedTaskIds() []durable.TaskId
- func (tx *Transaction) Doc(token durable.AnyDocToken, args ...any) (*delta.Object, error)
- func (tx *Transaction) Entry(id durable.EntryId) (*durable.EntryRecord, error)
- func (tx *Transaction) ForkConversation(parentConversationId durable.ConversationId, at durable.EntryId, ...) (durable.ConversationRecord, error)
- func (tx *Transaction) HasTableWrite() bool
- func (tx *Transaction) LatestEntryId(conversationId durable.ConversationId) (*durable.EntryId, error)
- func (tx *Transaction) LatestHeadMarker(conversationId durable.ConversationId) (*durable.EntryRecord, error)
- func (tx *Transaction) PlaceSubmission(id durable.SubmissionId, entry durable.EntryId) error
- func (tx *Transaction) RetireDoc(token durable.AnyDocToken, args ...any) error
- func (tx *Transaction) ScanConversations(query durable.ConversationQuery, limit int, cursor durable.Cursor) (durable.Page[durable.ConversationRecord, durable.Cursor], error)
- func (tx *Transaction) ScanEntries(query durable.EntryQuery, limit int, cursor durable.Cursor) (durable.Page[durable.EntryRecord, durable.Cursor], error)
- func (tx *Transaction) ScanTasks(query durable.TaskQuery, limit int, cursor durable.Cursor) (durable.Page[AnyTaskRecord, durable.Cursor], error)
- func (tx *Transaction) SetTask(value AnyTaskRecord) error
- func (tx *Transaction) SettleSubmission(id durable.SubmissionId, settlement durable.SubmissionSettlement) error
- func (tx *Transaction) StagedConversations() []durable.ConversationRecord
- func (tx *Transaction) StagedTasks() []AnyTaskRecord
- func (tx *Transaction) Submission(id durable.SubmissionId) (*durable.SubmissionRecord, error)
- func (tx *Transaction) SubmissionByRequest(conversationId durable.ConversationId, requestId string) (*durable.SubmissionRecord, error)
- func (tx *Transaction) Task(id durable.TaskId) (*AnyTaskRecord, error)
- func (tx *Transaction) WriteKeys() []string
- type TransactionScope
- type Writer
- func (writer *Writer) Admit(spec PartSpec) *Part
- func (writer *Writer) Drained() <-chan struct{}
- func (writer *Writer) Gate(key string) <-chan struct{}
- func (writer *Writer) Queued() int
- func (writer *Writer) Touches(key string) int
- func (writer *Writer) Unpublished() int
- func (writer *Writer) Wait()
- type WriterHost
Constants ¶
const ( // RootsKey is the ownerless conversations with live work below them, which global idle walks from. RootsKey = "roots" // IntentKey is the live tasks with cancellation intent: abort marks, and held outcomes other than `completed`. IntentKey = "intent" // AllKeys is every unpublished write: what a read that cannot be keyed, such as a scan, touches. AllKeys = "*" )
Variables ¶
var ErrSessionClosed = errors.New("Session is closed")
ErrSessionClosed is upstream's "Session is closed".
var ErrSessionClosedEnd = errors.New("session closed")
ErrSessionClosedEnd is the error a synchronous observer fails with when the Session closes without having failed (session.ts closeEnds: "session closed"); an adapter following the Session reads it as a reason to follow the next one. Each close makes its own error wrapping it, as Pi makes a new Error per close.
Functions ¶
func AppendKey ¶
func AppendKey(id durable.ConversationId) string
AppendKey is the newest entries of a conversation: appended blind, read by scans, the newest entry, and head markers.
func CloseEnds ¶
CloseEnds is how a Session's close ends what follows it (session.ts closeEnds, decision "Slice 8 S1"), made once per close. An app's watch ends ended; a synchronous observer (an adapter following the Session, which may open it again) fails with ErrSessionClosedEnd, so it follows the next Session. A failed Session ends both failed with its error.
func Contained ¶
func Contained(callback func(), onError func(error))
Contained is contained for the Harness: it runs a callback that must not fail its caller and hands a panic to onError. Ports session.ts contained.
func ConversationKey ¶
func ConversationKey(id durable.ConversationId) string
ConversationKey is a conversation record.
func DocumentKey ¶
DocumentKey is a document address (`AddressId()`): its current incarnation, value, and held changes.
func DocumentRetention ¶
DocumentRetention returns ms when it is a number of milliseconds, 0 or more (+Inf keeps documents); otherwise the default. A nil ms and a NaN are not such a number.
func Enter ¶
Enter is enter for the Harness's own waits that are not on one channel (a select of several): the delivery the calling goroutine runs, and the continuation ctx carries, have entered. Call it once the wait is known to block.
func IncarnationKey ¶
func IncarnationKey(id durable.DocumentId) string
IncarnationKey is a document incarnation, for reads by its ID.
func NewObservation ¶
func NewObservation[T any](value T, guarded interface{ Detach() }) durable.Observation[T]
NewObservation returns the Observation of a guarded observer attached at value (session.ts observation).
func NewSessionWatch ¶
func NewSessionWatch[T any](session *SessionImpl, value T, detach func()) *chord.Watch[T]
NewSessionWatch returns a Chord Watch whose deliveries run on the Session's delivery scheduler and whose listener failures go to the Session's report, as Pi's Durable builds each Watch with (error) => session.report(error) (session.ts #attachDocument, view.ts, task-graph.ts). detach runs once when the watch ends.
func OwnedKey ¶
OwnedKey is a node of the scheduler's ownership tree (a task ID, or `c<conversation ID>`): the live work listed below it. Written by task creation and a task becoming terminal for every node from the task's parent up to and including the nearest live task or the root conversation; read by every walk that expands the node.
func PersistWithin ¶
PersistWithin returns ms when it is a number of milliseconds, 0 or more (+Inf waits for a reading or writing commit or close); otherwise the default (session.ts persistWithin).
func RequestKey ¶
func RequestKey(conversationId durable.ConversationId, requestId string) string
RequestKey is the submission a conversation's request ID names.
func ScopeKey ¶
func ScopeKey(scope durable.DocumentRecordScope) string
ScopeKey is the incarnations alive in a scope: created and retired blind, read by scans and the task-document index.
func ScopeOf ¶
ScopeOf is storage's publication scope (the PublishingStorage capability), for a wrapper to expose as its own; nil when it has none.
func SubmissionKey ¶
func SubmissionKey(id durable.SubmissionId) string
SubmissionKey is a submission record.
func TableKeys ¶
func TableKeys(writes []durable.StorageWrite, keys *[]string)
TableKeys appends the keys of the table records in writes to keys; document writes are keyed by the transaction, which knows addresses.
Types ¶
type AnyTaskRecord ¶
AnyTaskRecord is a task record with JSON input, checkpoint, and result.
type CachedSizes ¶
type CachedSizes struct {
Conversations int
Tasks int
LiveTasks int
Awaited int
Waits int
Submissions int
}
CachedSizes is the records kept per table.
type CachedStorage ¶
type CachedStorage struct {
// contains filtered or unexported fields
}
CachedStorage serves hot record reads from memory: conversations, tasks, and written submissions, each table bounded by a count, the least recently used record leaving first, except live tasks, which are kept until they end, and the ended tasks a task waits on, kept until it moved on from its wait: a task's record is read again at each of its state changes, a waiter reads the outcomes of what it waited on once it resumes (`runtime.outcomes()`), and both are bounded by live work, which the scheduler keeps in memory too. Without that, a burst of more tasks than the count would make each of those reads a Storage read on the line. Every commit goes through it, and one process owns a Storage, so it applies each batch as it is published and never goes stale: Commit's batches when the Session publishes them (Published), not at their durability receipts. A read result is kept only when no commit published since the read started wrote its record, as the read may not observe that commit; versions are kept only for records with a read in flight. Entries, scans, and documents pass through: the Session keeps documents and the newest entry per conversation itself, and context ranges hold the entries a run reads.
Not for a read-only Session: another process writes its Storage.
func NewCachedStorage ¶
func NewCachedStorage(storage durable.Storage) *CachedStorage
NewCachedStorage caches the record reads of storage.
func (*CachedStorage) Close ¶
func (cached *CachedStorage) Close(ctx context.Context) error
Close passes through.
func (*CachedStorage) Commit ¶
func (cached *CachedStorage) Commit(ctx context.Context, batches [][]durable.StorageWrite, receive func(index int, seq durable.Seq)) (durable.CommitResult, error)
Commit passes the batches through; the Session applies each one with Published when it publishes it.
func (*CachedStorage) Conversation ¶
func (cached *CachedStorage) Conversation(ctx context.Context, id durable.ConversationId) (*durable.ConversationRecord, error)
Conversation serves a kept record without a read.
func (*CachedStorage) Document ¶
func (cached *CachedStorage) Document(ctx context.Context, id durable.DocumentId, at durable.DocumentPoint) (*durable.StoredDocument, error)
Document passes through.
func (*CachedStorage) Entry ¶
func (cached *CachedStorage) Entry(ctx context.Context, id durable.EntryId) (*durable.EntryAt, error)
Entry passes through.
func (*CachedStorage) FindDocument ¶
func (cached *CachedStorage) FindDocument(ctx context.Context, address durable.DocumentAddress, at durable.DocumentPoint) (*durable.DocumentRecord, error)
FindDocument passes through.
func (*CachedStorage) FindLatestHeadMarker ¶
func (cached *CachedStorage) FindLatestHeadMarker(ctx context.Context, conversationId durable.ConversationId, atOrBeforeEntryId *durable.EntryId) (*durable.EntryRecord, error)
FindLatestHeadMarker passes through.
func (*CachedStorage) MintId ¶
func (cached *CachedStorage) MintId() (int64, error)
MintId passes through.
func (*CachedStorage) Published ¶
func (cached *CachedStorage) Published(writes []durable.StorageWrite)
Published applies a batch Commit stored, when the Session publishes it. Its records are kept as they are, no deep copies: the cache keeps a copy of each record's struct (a write carries it by value), and what the record references, such as its state and memos, is the write's own, shared and not duplicated.
func (*CachedStorage) Publishing ¶
func (cached *CachedStorage) Publishing(ctx context.Context, publish func())
Publishing is the backend's own scope for a publication when it has one; otherwise it runs publish directly.
func (*CachedStorage) ReadsInFlight ¶
func (cached *CachedStorage) ReadsInFlight() int
ReadsInFlight is the records with a read in flight, for tests that bound memory.
func (*CachedStorage) ScanConversations ¶
func (cached *CachedStorage) ScanConversations(ctx context.Context, query durable.ConversationQuery, limit int, cursor durable.Cursor) (durable.Page[durable.ConversationRecord, durable.Cursor], error)
ScanConversations passes through.
func (*CachedStorage) ScanDocuments ¶
func (cached *CachedStorage) ScanDocuments(ctx context.Context, query durable.DocumentQuery, limit int, cursor durable.Cursor) (durable.Page[durable.DocumentRecord, durable.Cursor], error)
ScanDocuments passes through.
func (*CachedStorage) ScanEntries ¶
func (cached *CachedStorage) ScanEntries(ctx context.Context, query durable.EntryQuery, limit int, cursor durable.Cursor) (durable.Page[durable.EntryRecord, durable.Cursor], error)
ScanEntries passes through.
func (*CachedStorage) ScanSubmissions ¶
func (cached *CachedStorage) ScanSubmissions(ctx context.Context, query durable.SubmissionQuery, limit int, cursor durable.Cursor) (durable.Page[durable.SubmissionRecord, durable.Cursor], error)
ScanSubmissions passes through.
func (*CachedStorage) ScanTasks ¶
func (cached *CachedStorage) ScanTasks(ctx context.Context, query durable.TaskQuery, limit int, cursor durable.Cursor) (durable.Page[anyTaskRecord, durable.Cursor], error)
ScanTasks passes through.
func (*CachedStorage) Sizes ¶
func (cached *CachedStorage) Sizes() CachedSizes
Sizes is the records kept per table, for tests that bound memory.
func (*CachedStorage) Submission ¶
func (cached *CachedStorage) Submission(ctx context.Context, id durable.SubmissionId) (*durable.SubmissionRecord, error)
Submission is cached as written only: this process writes every submission it settles, and a read one is usually settled.
func (*CachedStorage) SubmissionByRequest ¶
func (cached *CachedStorage) SubmissionByRequest(ctx context.Context, conversationId durable.ConversationId, requestId string) (*durable.SubmissionRecord, error)
SubmissionByRequest passes through.
func (*CachedStorage) VisibleEntry ¶
func (cached *CachedStorage) VisibleEntry(ctx context.Context, conversationId durable.ConversationId, id durable.EntryId) (*durable.EntryAt, error)
VisibleEntry passes through.
type Continuation ¶
type Continuation struct {
// contains filtered or unexported fields
}
Continuation is the code a caller runs after a wait of the Session returned, which the Session waits for, up to the point the caller says it is done (Entered) or waits in the Session again with the context of the Continuation. It is the analogue of a promise's continuation running up to its next await, for the caller that cannot do without that order; no caller needs one to be woken in line order.
func WithContinuation ¶
func WithContinuation(ctx context.Context) (context.Context, *Continuation)
WithContinuation returns a context for Session calls whose continuation the Session waits for, and the Continuation: the caller must call Entered once the code that follows each call has run, or wait in the Session again with this context. Until it does, the publication of the next part of the storage call that woke it waits.
func (*Continuation) Entered ¶
func (continuation *Continuation) Entered()
Entered says the code that followed the wait calls returned from ran up to here: the resumptions it held are acknowledged. It is safe to call on a nil Continuation and at any time.
type ConversationTails ¶
type ConversationTails struct {
// contains filtered or unexported fields
}
ConversationTails is the newest entry ID and newest head marker per conversation, for the Session that owns its Storage: every entry is written by one of its commits, so Apply keeps both current, and a value read from Storage stays valid until the next entry of that conversation. Read only on the Session line after touching the conversation's appends, so no commit that appends to it is unpublished and a value read from Storage can be kept. The newest entry visible from a conversation is its own newest, or for a fork without entries of its own the parent's entry at the fork point: IDs grow, so a conversation's own new entry is always the newest. Each map is bounded by a count, the least recently used conversation leaving first.
func NewConversationTails ¶
func NewConversationTails() *ConversationTails
NewConversationTails returns tails that know no conversation.
func (*ConversationTails) Apply ¶
func (tails *ConversationTails) Apply(writes []durable.StorageWrite)
Apply is called at a commit's publication: apply a durable batch.
func (*ConversationTails) Latest ¶
func (tails *ConversationTails) Latest(conversationId durable.ConversationId, read func() (*durable.EntryId, error)) (*durable.EntryId, error)
Latest is the newest entry ID visible from conversationId, nil for none, read with read when not known.
func (*ConversationTails) Marker ¶
func (tails *ConversationTails) Marker(conversationId durable.ConversationId, atOrBefore *durable.EntryId, read func() (*HeadMarker, error)) (*HeadMarker, error)
Marker is the newest visible head marker at or before atOrBefore (any when nil), nil for none, read with read when not known. The newest marker answers every cutoff at or after it, and no marker answers every cutoff.
func (*ConversationTails) Markers ¶
func (tails *ConversationTails) Markers() int
Markers is how many conversations have their newest head marker kept, for tests that bound memory.
func (*ConversationTails) Peek ¶
func (tails *ConversationTails) Peek(conversationId durable.ConversationId) (durable.EntryId, TailState)
Peek is the newest entry ID of conversationId if known, without reading: TailNone for none, TailUnknown when unknown. The ID is meaningful only with TailKnown.
func (*ConversationTails) Size ¶
func (tails *ConversationTails) Size() int
Size is how many conversations have their newest entry kept, for tests that bound memory.
type CreateSessionOptions ¶
type CreateSessionOptions struct {
// Now is the wall clock in milliseconds for task times; the default is the system clock.
Now func() float64
// DocumentRetentionMs is how long a loaded document that no watch observes stays in memory after
// its last read or write; the next access loads it from Storage. Observed documents always stay. Nil selects the
// default, ten minutes; 0 drops a document right after use; +Inf keeps documents. Anything else that is not a
// number of milliseconds, 0 or more, means the default.
DocumentRetentionMs *float64
// SetTimer arms the timers that evict idle documents; nil selects Go timers (see durable.SetTimer).
SetTimer durable.SetTimer
// PersistWithinMs is the default window of a deferred commit (durable.CommitPersistence): how long it may stay in memory before it is stored.
// Nil selects the default, 1,000 ms; +Inf waits for a reading or writing commit or close.
// Anything else that is not a number of milliseconds, 0 or more, means the default.
PersistWithinMs *float64
}
CreateSessionOptions is the optional argument of CreateSession.
type DocumentCacheSizes ¶
type DocumentCacheSizes struct {
// Cached is the number of cached documents.
Cached int
// Idle is the number of cached documents with no observer attached.
Idle int
// Attached is the number of incarnations pinned by an observer.
Attached int
// Sweeps is the number of eviction jobs queued on the line so far.
Sweeps int
// Held is the number of documents with held changes: deferred commits adopted in memory and not stored yet.
Held int
// TaskDocuments is the number of live tasks whose documents are indexed.
TaskDocuments int
// Tails is the number of conversations whose newest entry is kept.
Tails int
}
DocumentCacheSizes is what the document cache holds.
type GatedStorage ¶
type GatedStorage struct {
// contains filtered or unexported fields
}
GatedStorage is the Storage a job on the line reads through: every read first touches its key (`touch`), which waits while the key has an unpublished writer, so the read sees what the line admitted before it. Scans that cannot be keyed touch AllKeys. Commits and Close pass through; the line never commits through it.
func NewGatedStorage ¶
func NewGatedStorage(storage durable.Storage, touch func(ctx context.Context, key string) error) *GatedStorage
NewGatedStorage gates the reads of storage on touch, which blocks until the gate of the newest unpublished writer of key opened and returns nil at once when there is none.
func (*GatedStorage) Close ¶
func (gated *GatedStorage) Close(ctx context.Context) error
Close passes through.
func (*GatedStorage) Commit ¶
func (gated *GatedStorage) Commit(ctx context.Context, batches [][]durable.StorageWrite, receive func(index int, seq durable.Seq)) (durable.CommitResult, error)
Commit passes through.
func (*GatedStorage) Conversation ¶
func (gated *GatedStorage) Conversation(ctx context.Context, id durable.ConversationId) (*durable.ConversationRecord, error)
Conversation reads once the conversation has no unpublished writer.
func (*GatedStorage) Document ¶
func (gated *GatedStorage) Document(ctx context.Context, id durable.DocumentId, at durable.DocumentPoint) (*durable.StoredDocument, error)
Document reads once the incarnation has no unpublished writer.
func (*GatedStorage) FindDocument ¶
func (gated *GatedStorage) FindDocument(ctx context.Context, address durable.DocumentAddress, at durable.DocumentPoint) (*durable.DocumentRecord, error)
FindDocument reads once the address has no unpublished writer.
func (*GatedStorage) FindLatestHeadMarker ¶
func (gated *GatedStorage) FindLatestHeadMarker(ctx context.Context, conversationId durable.ConversationId, atOrBeforeEntryId *durable.EntryId) (*durable.EntryRecord, error)
FindLatestHeadMarker reads once the conversation's appends and creation have no unpublished writer.
func (*GatedStorage) MintId ¶
func (gated *GatedStorage) MintId() (int64, error)
MintId passes through.
func (*GatedStorage) ScanConversations ¶
func (gated *GatedStorage) ScanConversations(ctx context.Context, query durable.ConversationQuery, limit int, cursor durable.Cursor) (durable.Page[durable.ConversationRecord, durable.Cursor], error)
ScanConversations reads once nothing is unpublished.
func (*GatedStorage) ScanDocuments ¶
func (gated *GatedStorage) ScanDocuments(ctx context.Context, query durable.DocumentQuery, limit int, cursor durable.Cursor) (durable.Page[durable.DocumentRecord, durable.Cursor], error)
ScanDocuments reads once the scope has no unpublished writer.
func (*GatedStorage) ScanEntries ¶
func (gated *GatedStorage) ScanEntries(ctx context.Context, query durable.EntryQuery, limit int, cursor durable.Cursor) (durable.Page[durable.EntryRecord, durable.Cursor], error)
ScanEntries reads once the conversation's appends and creation have no unpublished writer.
func (*GatedStorage) ScanSubmissions ¶
func (gated *GatedStorage) ScanSubmissions(ctx context.Context, query durable.SubmissionQuery, limit int, cursor durable.Cursor) (durable.Page[durable.SubmissionRecord, durable.Cursor], error)
ScanSubmissions reads once nothing is unpublished.
func (*GatedStorage) ScanTasks ¶
func (gated *GatedStorage) ScanTasks(ctx context.Context, query durable.TaskQuery, limit int, cursor durable.Cursor) (durable.Page[durable.TaskRecord[durable.JsonValue, durable.JsonValue, durable.JsonValue], durable.Cursor], error)
ScanTasks reads once nothing is unpublished.
func (*GatedStorage) Submission ¶
func (gated *GatedStorage) Submission(ctx context.Context, id durable.SubmissionId) (*durable.SubmissionRecord, error)
Submission reads once the submission has no unpublished writer.
func (*GatedStorage) SubmissionByRequest ¶
func (gated *GatedStorage) SubmissionByRequest(ctx context.Context, conversationId durable.ConversationId, requestId string) (*durable.SubmissionRecord, error)
SubmissionByRequest reads once the request key has no unpublished writer.
func (*GatedStorage) Task ¶
func (gated *GatedStorage) Task(ctx context.Context, id durable.TaskId) (*durable.TaskRecord[durable.JsonValue, durable.JsonValue, durable.JsonValue], error)
Task reads once the task has no unpublished writer.
func (*GatedStorage) VisibleEntry ¶
func (gated *GatedStorage) VisibleEntry(ctx context.Context, conversationId durable.ConversationId, id durable.EntryId) (*durable.EntryAt, error)
VisibleEntry reads once neither the conversation nor the entry has an unpublished writer: visibility follows the conversation's immutable ancestry, and the conversation may be unpublished itself.
type GuardedCommitObserver ¶
type GuardedCommitObserver struct {
// contains filtered or unexported fields
}
GuardedCommitObserver is a host's CommitObserver behind the guard.
func (*GuardedCommitObserver) Advance ¶
Advance passes a call on; a panic of the observer is reported, and detaches and ends it listener_error.
type GuardedObserver ¶
type GuardedObserver[T any] struct { // contains filtered or unexported fields }
GuardedObserver is a host's Observer[T] behind the guard. detach is the source's; the guard's Detach is the observation's.
func GuardObserver ¶
func GuardObserver[T any](observer durable.Observer[T], detach func(), report func(error)) *GuardedObserver[T]
GuardObserver guards observer.
func (*GuardedObserver) Advance ¶
Advance passes a call on; a panic of the observer is reported, and detaches and ends it listener_error.
type HeadMarker ¶
type HeadMarker = durable.EntryRecord
HeadMarker is an entry that carries a Head: the marker of a context range.
type Hooks ¶
type Hooks struct {
// ConversationCreated runs inside every transaction that creates or forks a conversation, after the conversation record is
// staged. A plain Session stages nothing.
ConversationCreated func(tx *Transaction, record durable.ConversationRecord) error
// MembershipKeys returns the keys a commit writes besides its records' (Transaction.WriteKeys), at its logical admission,
// on the line: a Harness adds the ownership memberships its task changes write. A plain Session adds none.
MembershipKeys func(tx *Transaction) ([]string, error)
// BeforeClose runs after close seals admission and before the line closes Storage.
BeforeClose func()
// Report receives the Session's failure and the errors of listeners, which never fail what ran them; info says
// which. A plain Session drops them.
//
// ctx carries the telemetry span the report is raised under (chord/context.Telemetry); context.Background() has none.
Report func(ctx context.Context, err error, info durable.ReportInfo)
// SetTimer arms the timers that evict idle documents (HarnessOptions.SetTimer); nil selects Go timers.
SetTimer durable.SetTimer
// ReadOnly refuses every commit with writes (HarnessOptions.ReadOnly).
ReadOnly bool
// PersistWithinMs is the default window of a deferred commit, read at each use (HarnessOptions.settings.progress.persistWithinMs);
// nil selects the default, 1,000 ms.
PersistWithinMs func() *float64
}
Hooks are the extension points a Harness overrides on its Session.
type LineDocument ¶
type LineDocument struct {
Record durable.DocumentRecord
Version int
Value durable.JsonObject
}
LineDocument is a conversation document's current incarnation and value.
type LineSizes ¶
type LineSizes struct {
// Outstanding is the number of jobs whose outcome is not delivered yet.
Outstanding int
// Unpublished is the number of keys with an unpublished writer.
Unpublished int
// Reads is the number of record reads in flight in the cache.
Reads int
}
LineSizes is what the line holds, for tests that bound memory: all three are zero once the line is idle.
type LineTicket ¶
type LineTicket struct {
// contains filtered or unexported fields
}
LineTicket is a position on the mutation line taken before its job runs.
func (*LineTicket) Release ¶
func (ticket *LineTicket) Release()
Release gives up the position. Jobs queued behind it keep waiting for the jobs queued before it.
type LoadedDocument ¶
type LoadedDocument struct {
AddressId string
Record durable.DocumentRecord
// ValueVersion is the definition version whose shape the tracked value has; access with another version reloads
// from Storage.
ValueVersion int
Tracker *delta.Tracker
// contains filtered or unexported fields
}
LoadedDocument is one committed document incarnation owned by the Session tracker cache.
func (*LoadedDocument) StoredVersion ¶
func (loaded *LoadedDocument) StoredVersion() int
StoredVersion returns the persisted definition version.
type ObservedCommit ¶
type ObservedCommit struct {
// Memory is set for a commit held in memory (durable.CommitPersistence); Seq is then zero.
Memory bool
Seq durable.Seq
Changes []durable.CommitChange
}
ObservedCommit is what the Session's own components observe of one commit (FollowCommits): a stored commit with its own changes, or a deferred one adopted in memory only (Memory), which changes documents only. Memory is never behind: a later store of held changes is not observed again.
type Parked ¶
type Parked struct {
// contains filtered or unexported fields
}
Parked is a wait of the Session registered before it blocks: a publication that readies it waits for it to resume.
func (*Parked) Abandon ¶
func (parked *Parked) Abandon()
Abandon acknowledges a wait that ended without a publication having woken it (its context was cancelled, or a close rejected it): the goroutine's continuation is not one a publication orders (Pi orders what a publication resolves, not a rejected wait), so a Continuation does not hold the publications that follow. It is safe on nil, and again.
type Part ¶
type Part struct {
PartSpec
// contains filtered or unexported fields
}
Part is an admitted part and its outcome.
type PartSpec ¶
type PartSpec struct {
// Index is the line index of the job that admitted it: a failure it causes makes only later jobs' outcomes SessionFailed.
Index int
Writes []durable.StorageWrite
// Keys are the keys it writes: a read of one waits for its publication.
Keys []string
Ctx context.Context
// Publish publishes it in memory, in line order, once it is durable (with its seq) or, held, once the parts before it are
// (seq is then 0).
Publish func(seq durable.Seq) *PublishFailure
// Published, when set, runs right after its keys left the unpublished set, still inside its publication: what only
// schedules work (an eviction sweep a document's use arms), which has to see the keys gone.
Published func()
// Discard is called when it will never be published: it aborts what it prepared.
Discard func()
}
PartSpec is one logical commit the line admitted: stored (Writes, never empty), or held in memory only (no Writes).
type PublishFailure ¶
type PublishFailure struct {
Kind PublishFailureKind
Err error
}
PublishFailure is a part's own failure at publication: memory could not adopt it, or one of the Session's own observers panicked.
type PublishFailureKind ¶
type PublishFailureKind int
PublishFailureKind says what failed a part at publication.
const ( // PublishAdoption is memory that could not adopt the part. PublishAdoption PublishFailureKind = iota + 1 // PublishListener is one of the Session's own observers that panicked. PublishListener )
type SessionImpl ¶
type SessionImpl struct {
// contains filtered or unexported fields
}
SessionImpl is the Session kernel: one mutation line, the group-commit writer, the loaded document tracker cache, and committed publication.
Only committed state is observable: a commit's callback runs while earlier commits' storage calls are in flight, but a job that reads what an unpublished commit wrote waits for it, and everything a commit makes visible happens at its publication.
func CreateSession ¶
func CreateSession(storage durable.Storage, options ...CreateSessionOptions) *SessionImpl
CreateSession opens a Session kernel over one storage backend.
func NewSessionImpl ¶
func NewSessionImpl(storage durable.Storage, hooks Hooks, now func() float64, documentRetentionMs func() *float64) *SessionImpl
NewSessionImpl opens a Session kernel with extension hooks. now is the wall clock in milliseconds for task times; nil selects the system clock. documentRetentionMs is read at each use and yields the document retention (see CreateSessionOptions.DocumentRetentionMs); nil selects the default.
func (*SessionImpl) AssertHealthy ¶
func (session *SessionImpl) AssertHealthy() error
AssertHealthy is internal: SessionFailed once the Session failed, nil otherwise (session.ts assertHealthy).
func (*SessionImpl) Await ¶
func (session *SessionImpl) Await(ctx context.Context, done <-chan struct{})
Await blocks until done is closed, as a wait of the Session: Park, the receive, Resume.
func (*SessionImpl) AwaitDeliveriesEntered ¶
func (session *SessionImpl) AwaitDeliveriesEntered(ctx context.Context) error
AwaitDeliveriesEntered blocks until every watch delivery scheduled before the call has entered: the synchronous part of its listener ran (the call returned), or it went on to a wait of the Session (chord.DeliveryEntered). A Harness wait that resumes its caller calls it, as upstream's drain microtask runs the listener up to its first await before the code awaiting the wait's promise resumes. A call from inside a delivery (a listener that waits for the Harness) enters that delivery and does not wait for it. A listener blocked on a plain lock or channel the Session cannot see has not entered until it returns: if the caller holds that lock the wait does not return, the one gap Go has where upstream, with no locks, has none (pig divergence (D224); the listener calls chord.DeliveryEntered before such a block). It returns the cause of ctx when ctx ends the wait.
func (*SessionImpl) AwaitTouch ¶
func (session *SessionImpl) AwaitTouch(ctx context.Context, key string) error
AwaitTouch is Touch as a blocking call, which also checks that the Session is healthy once the gate opened. It returns at once when key has no unpublished writer. A gate always opens, by a publication or by the Session's failure, so the wait is not cancellable (the context is only the caller's, as GatedStorage's touch passes it).
func (*SessionImpl) Close ¶
func (session *SessionImpl) Close(ctx context.Context) error
Close seals admission, settles admitted commits, then closes Storage. Close listeners run synchronously when close begins, before the BeforeClose hook. Close drains the writer: the commits in flight and their publication, the held changes stored through it. Cancelling ctx stops waiting without interrupting the close; an already cancelled ctx returns its cause at once, as upstream's awaitWithContext rejects for an aborted signal.
func (*SessionImpl) Closed ¶
func (session *SessionImpl) Closed() <-chan struct{}
Closed returns a channel closed once the Session ended: after close reached the backend, or a failure ended it.
func (*SessionImpl) Commit ¶
func (session *SessionImpl) Commit(ctx context.Context, change func(tx durable.Tx) (any, error), options ...durable.CommitOptions) (any, error)
Commit runs one atomic transaction on the Session mutation line. options.Persistence may defer storing it (durable.CommitPersistence).
func (*SessionImpl) CommitInternal ¶
func (session *SessionImpl) CommitInternal(ctx context.Context, change func(tx *Transaction) (any, error)) (any, error)
CommitInternal is internal: CommitWith for a commit of the scheduler's own whose outcome goes only to scheduler code. When it writes nothing and waited at no gate, it is equivalent to having run before every unpublished commit, so its outcome is delivered at once, ahead of theirs. One that writes is never exempt: its outcome waits for its own publication and every earlier outcome, so no invocation starts on a reservation that is not durable (session.ts commitInternal).
func (*SessionImpl) CommitInternalWithTicket ¶
func (session *SessionImpl) CommitInternalWithTicket(ticket *LineTicket, ctx context.Context, change func(tx *Transaction) (any, error)) (any, error)
CommitInternalWithTicket is CommitInternal at the ticket's position.
func (*SessionImpl) CommitSubscriptions ¶
func (session *SessionImpl) CommitSubscriptions() int
CommitSubscriptions reports the number of live commit subscriptions. Upstream tests count them by wrapping observeCommits (harness-lifecycle.test.ts:331); a Go method cannot be patched.
func (*SessionImpl) CommitWith ¶
func (session *SessionImpl) CommitWith(ctx context.Context, change func(tx *Transaction) (any, error), scope TransactionScope, options ...durable.CommitOptions) (any, error)
CommitWith is the internal commit exposing the concrete transaction and its internal operations, such as the reserved-ID root bootstrap and task replacement. scope sets the default task conversation and the task attributed to appended entries. It returns once the commit is stored and published and every earlier job's outcome is delivered.
func (*SessionImpl) CommitWithTicket ¶
func (session *SessionImpl) CommitWithTicket(ticket *LineTicket, ctx context.Context, change func(tx *Transaction) (any, error), scope TransactionScope, options ...durable.CommitOptions) (any, error)
CommitWithTicket runs a commit at the ticket's position and releases it.
func (*SessionImpl) ConversationDocumentOnLine ¶
func (session *SessionImpl) ConversationDocumentOnLine(ctx context.Context, token durable.AnyDocToken, conversationId durable.ConversationId) (*LineDocument, error)
ConversationDocumentOnLine returns a conversation document's current incarnation and value for a job already running on the line (see ReadOnLine); nil when absent.
func (*SessionImpl) DeferUntilPublished ¶
func (session *SessionImpl) DeferUntilPublished(run func())
DeferUntilPublished runs run once the publication in progress has run every host listener, and at once when none is. Upstream settles a waiter by resolving a promise inside an observer, and the awaiting code resumes after the microtask that dispatches the commit to host listeners; a goroutine woken inside an observer would race them, so waiters wake through this, and so does the abort of a task the commit newly marks (upstream queues it in a microtask). Observers call it from the publishing goroutine, as publications are serialized by the writer. Once the work ran, the publication returns only when the registered waits it readied (Park, Await) have resumed, so the next part of the call is published after what this one resolved started (the hop). A wait that is not registered is not waited for.
func (*SessionImpl) DocumentCacheSizes ¶
func (session *SessionImpl) DocumentCacheSizes() DocumentCacheSizes
DocumentCacheSizes reports how many documents the cache holds, how many are idle, how many incarnations are pinned, how many eviction jobs were queued on the line so far, and how many documents have held changes.
func (*SessionImpl) Drained ¶
func (session *SessionImpl) Drained() <-chan struct{}
Drained is internal: a channel closed once every part admitted so far is published or never will be; nil when none is pending (session.ts writer.drained, the gate of AllKeys).
func (*SessionImpl) End ¶
func (session *SessionImpl) End() durable.SessionEnd
End returns how the Session ended once Closed is closed.
func (*SessionImpl) Fail ¶
func (session *SessionImpl) Fail(ctx context.Context, err error)
Fail fails the Session with err: the first wins, and it is reported once. Admission ends, and the close listeners run now; they read the error from Failure. The Storage guard calls it; the Harness also calls it for an error in its scheduler's own commits. The job on the line is the one whose outcome the failure is: later jobs' outcomes become SessionFailed.
func (*SessionImpl) Failed ¶
func (session *SessionImpl) Failed() <-chan struct{}
Failed returns a channel closed the moment the Session fails, before work underway has ended.
func (*SessionImpl) Failure ¶
func (session *SessionImpl) Failure() error
Failure returns the first error that failed the Session, or nil.
func (*SessionImpl) FollowCommits ¶
func (session *SessionImpl) FollowCommits(listener func(ctx context.Context, commit ObservedCommit)) func()
FollowCommits follows every commit as memory adopts it (ObservedCommit), for the Session's own components, whose state follows memory. A panic leaves that state behind, so it fails the Session instead of being reported: once the host listeners got the commit. They run at the commit's publication, on the writer's goroutine, so they call no Storage method, run no task code, and contain every host callback; the waits they resolve and the aborts they queue (DeferUntilPublished) run after the host listeners.
func (*SessionImpl) GateTouches ¶
func (session *SessionImpl) GateTouches(key string) int
GateTouches reports how many Gate calls returned the gate of key's newest unpublished writer, whoever made them (a job's Touch, a retention probe), so a test can wait until the one caller it expects has reached the wait for that publication without sleeping.
func (*SessionImpl) KnownLatestEntryId ¶
func (session *SessionImpl) KnownLatestEntryId(conversationId durable.ConversationId) (id *durable.EntryId, known bool)
KnownLatestEntryId is internal: the newest entry ID of conversationId as known from the Session's commits right now, without reading. known is false when it is not known (and always for a read-only Session); a nil id is a conversation with no entries.
func (*SessionImpl) LatestEntryId ¶
func (session *SessionImpl) LatestEntryId(ctx context.Context, conversationId durable.ConversationId) (*durable.EntryId, error)
LatestEntryId is internal, on the Session line: the newest entry ID visible from conversationId, nil when it has none. Known from the Session's own commits when it owns its Storage, so it costs no Storage read after the first.
func (*SessionImpl) LatestHeadMarker ¶
func (session *SessionImpl) LatestHeadMarker(ctx context.Context, conversationId durable.ConversationId, atOrBefore *durable.EntryId) (*durable.EntryRecord, error)
LatestHeadMarker is internal, on the Session line: the newest visible head marker of conversationId at or before atOrBefore, any when nil; known from the Session's own commits as LatestEntryId is.
func (*SessionImpl) LineJobs ¶
func (session *SessionImpl) LineJobs() int
LineJobs reports the number of admitted line jobs that have not finished, so a caller can wait until work is queued behind a held job without sleeping.
func (*SessionImpl) LineSizes ¶
func (session *SessionImpl) LineSizes() LineSizes
LineSizes reports the sizes of the line's bookkeeping (session.ts lineSizes).
func (*SessionImpl) LineStorage ¶
func (session *SessionImpl) LineStorage() durable.Storage
LineStorage is internal: the Storage jobs on the line read through (Touch): each read waits while its key has an unpublished writer, so a job never observes state an earlier job admitted and the writer has not published. Off the line, use Storage (session.ts lineStorage).
func (*SessionImpl) ObserveCommits ¶
func (session *SessionImpl) ObserveCommits(observer durable.CommitObserver) durable.CommitObservation
ObserveCommits attaches a synchronous observer of every stored commit, with exactly what it stored. Its Advance runs once the commit is published, right after the Session's own observers (and inside the Storage's publication scope when it has one), on the writer's goroutine, before every wait the commit resolves and every abort it queues (in no order with watch listeners); a commit published while no observer was attached has no dispatch. It must not block or call Session operations. A panic is reported, detaches it, and ends it listener_error; End gets the Session's close after its last publication.
func (*SessionImpl) ObserveDocErased ¶
func (session *SessionImpl) ObserveDocErased(ctx context.Context, token durable.AnyDocToken, observer durable.Observer[durable.JsonObject], args ...any) (durable.Observation[durable.JsonObject], error)
ObserveDocErased attaches a synchronous observer to a document address, atomically on the Session line, as WatchDocErased acquires a watch; the observation is nil when the address is absent. ctx governs only the attachment.
func (*SessionImpl) ObserverSubscriptions ¶
func (session *SessionImpl) ObserverSubscriptions() int
ObserverSubscriptions reports the number of live observers of the Session's own (FollowCommits): a document watch holds one, which sees a commit held in memory when it is adopted.
func (*SessionImpl) OnJobEnd ¶
func (session *SessionImpl) OnJobEnd(end func())
OnJobEnd is internal, on the line: it calls end once the outcome of the job on the line settles, its commit published or never to be; at once off the line (session.ts onJobEnd). end runs on the goroutine that settles the outcome, so it must be quick and never block.
func (*SessionImpl) OwnsTransaction ¶
func (session *SessionImpl) OwnsTransaction(tx durable.Tx) (*Transaction, bool)
OwnsTransaction is internal: whether tx is the transaction of one of this Session's commits; it returns that transaction (session.ts `ownsTransaction`).
func (*SessionImpl) Park ¶
func (session *SessionImpl) Park(ctx context.Context, done <-chan struct{}) *Parked
Park registers the wait the calling goroutine is about to block in until done is closed, and returns the Parked it calls Resume on as soon as the wait returned, however it returned. It returns nil, which Resume accepts, when done is closed already: nothing is going to be readied. A ctx that carries a Continuation (WithContinuation) is the caller's: the continuation has entered once it parks.
func (*SessionImpl) ReadOnLine ¶
ReadOnLine runs a read-only job on the mutation line so multi-read derivations observe one committed state. It reads through storage, a view whose reads wait for the publication of what the line admitted before; its outcome comes after theirs (session.ts readOnLine).
func (*SessionImpl) ReadOnLineCtx ¶
func (session *SessionImpl) ReadOnLineCtx(ctx context.Context, job func(storage durable.Storage) (any, error)) (any, error)
ReadOnLineCtx is ReadOnLine for a caller whose ctx carries a line admission callback (internal/lineadmission): it runs once the job holds its position on the line, as a synchronous caller has extended upstream's Promise chain.
func (*SessionImpl) ReadWithTicket ¶
func (session *SessionImpl) ReadWithTicket(ticket *LineTicket, job func(storage durable.Storage) (any, error)) (any, error)
ReadWithTicket runs a read-only job at the ticket's position on the mutation line and releases it. The job reads through storage, whose reads wait for the publication of what the line admitted before.
func (*SessionImpl) ReadWithTicketCtx ¶
func (session *SessionImpl) ReadWithTicketCtx(ticket *LineTicket, ctx context.Context, job func(storage durable.Storage) (any, error)) (any, error)
ReadWithTicketCtx is ReadWithTicket for a caller whose ctx carries a Continuation (WithContinuation).
func (*SessionImpl) Report ¶
func (session *SessionImpl) Report(err error)
Report is session.ts report with its default info: it hands a non-fatal failure, such as the error of a state or watch listener, to the host; a plain Session drops it.
func (*SessionImpl) ReportAs ¶
func (session *SessionImpl) ReportAs(ctx context.Context, err error, info durable.ReportInfo)
ReportAs is session.ts report with info: it hands a non-fatal failure to the host; a plain Session drops it.
func (*SessionImpl) SnapshotAsOfErased ¶
func (session *SessionImpl) SnapshotAsOfErased(ctx context.Context, token durable.AnyDocToken, at durable.EntryId, args ...any) (durable.JsonObject, error)
SnapshotAsOfErased returns the committed value of a rewindable conversation document as of the visible entry at; args are the conversation ID, then the family key for families.
func (*SessionImpl) SnapshotErased ¶
func (session *SessionImpl) SnapshotErased(ctx context.Context, token durable.AnyDocToken, args ...any) (durable.JsonObject, error)
SnapshotErased returns the committed value of a document, or nil when absent. It never creates the document.
func (*SessionImpl) Storage ¶
func (session *SessionImpl) Storage() durable.Storage
Storage returns the Session's Storage behind its failure guard; every component of the Session reads and writes through it, also the reads off the Session line. A Harness passes it to its scheduler and context reads.
func (*SessionImpl) SubscribeClose ¶
func (session *SessionImpl) SubscribeClose(listener func()) func()
SubscribeClose registers a listener called synchronously when close begins. It must not panic, block, or call Session operations.
func (*SessionImpl) TakeLineTicket ¶
func (session *SessionImpl) TakeLineTicket() *LineTicket
TakeLineTicket takes the next line position now, or returns nil once close began.
func (*SessionImpl) Touch ¶
func (session *SessionImpl) Touch(key string) <-chan struct{}
Touch is internal, on the line: the gate of the newest unpublished writer of key (for AllKeys, of anything unpublished); nil when there is nothing to wait for. A job's every read touches its key first, so it never observes state an earlier job admitted and the writer has not published. A hit marks the job on the line (session.ts touch).
It takes only the writer's own lock and the job lock, never one a publication holds across its observers, so it is safe to call while holding a lock an observer takes. Once the gate fired, AssertHealthy checks the Session; AwaitTouch does both.
func (*SessionImpl) UnloadDocuments ¶
func (session *SessionImpl) UnloadDocuments() error
UnloadDocuments drops every loaded tracker on the mutation line, held changes stored first, through the writer after the calls in flight; later access cold-loads from Storage.
func (*SessionImpl) WaitDeliveries ¶
func (session *SessionImpl) WaitDeliveries()
WaitDeliveries blocks until every scheduled watch delivery has drained.
func (*SessionImpl) WatchDocErased ¶
func (session *SessionImpl) WatchDocErased(ctx context.Context, token durable.AnyDocToken, args ...any) (durable.WatchHandle[durable.JsonObject], error)
WatchDocErased returns a watch of a document's committed value, or nil when absent. The watch follows the document's address (kind, scope, and key) from the incarnation found at acquisition: a retirement is a call with Retired set, the last value the watch was given and no ops, and a document created there later arrives on the same watch. Cancelling ctx before the watch is returned rejects with the cancellation cause; afterwards it ends the watch with reason cancelled.
func (*SessionImpl) WriteAtClose ¶
func (session *SessionImpl) WriteAtClose(ctx context.Context, writes func() []durable.StorageWrite) error
WriteAtClose is for BeforeClose (session.ts writeAtClose): on the line, after every commit admitted before the seal has settled and been published, it writes what writes returns then through the writer, which waits for it. Nothing is published, since the Session is closing; a failed Session writes nothing.
type TailState ¶
type TailState int
TailState says what ConversationTails.Peek knows of a conversation's newest entry.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction is the transaction of one Session commit callback.
Every operation is tracked so callback settlement can reject and drain unfinished work. Session calls one settlement method, then either discards prepared changes or adopts them once after Storage succeeds.
func (*Transaction) AppendEntry ¶
func (tx *Transaction) AppendEntry(conversationId durable.ConversationId, value durable.EntryDraft) (durable.EntryRecord, error)
AppendEntry appends an entry; the returned record is Session-owned and immutable.
func (*Transaction) Context ¶
func (tx *Transaction) Context() context.Context
Context is internal: the context of the commit this transaction belongs to (transaction.ts `get context`). It is released once the transaction settles.
func (*Transaction) Conversation ¶
func (tx *Transaction) Conversation(id durable.ConversationId) (*durable.ConversationRecord, error)
Conversation returns the committed conversation, or nil.
func (*Transaction) CreateConversation ¶
func (tx *Transaction) CreateConversation(options durable.CreateConversationOptions) (durable.ConversationRecord, error)
CreateConversation creates a conversation with explicitly selected ownership.
func (*Transaction) CreateRootConversation ¶
func (tx *Transaction) CreateRootConversation() (durable.ConversationRecord, error)
CreateRootConversation is the internal bootstrap path for the reserved root identity.
func (*Transaction) CreateSubmission ¶
func (tx *Transaction) CreateSubmission(create durable.SubmissionCreate) (durable.SubmissionRecord, error)
CreateSubmission creates a raw submission record with a fresh ID; no admission rules apply.
func (*Transaction) CreateTaskErased ¶
func (tx *Transaction) CreateTaskErased(task durable.AnyTask, input durable.JsonValue, options durable.TaskOptions) (durable.TaskId, error)
CreateTaskErased creates a task of an erased definition.
func (*Transaction) CreateTaskFromSubmissions ¶
func (tx *Transaction) CreateTaskFromSubmissions(task durable.AnyTask, input durable.JsonValue, options durable.TaskOptions, submissionIds []durable.SubmissionId) (durable.TaskId, error)
CreateTaskFromSubmissions is CreateTaskErased with transaction.ts's internal TaskCreationOptions.submissionIds: run creation resolves the carriers of the submissions it starts for against staged records before reading storage. The first submission's carrier becomes the task's trace ("root" when it has none) and the carriers of the others its links.
func (*Transaction) CreatedTaskIds ¶
func (tx *Transaction) CreatedTaskIds() []durable.TaskId
CreatedTaskIds is internal: the IDs of the tasks this transaction creates (transaction.ts createdTaskIds).
func (*Transaction) Doc ¶
func (tx *Transaction) Doc(token durable.AnyDocToken, args ...any) (*delta.Object, error)
Doc returns the document's *delta.Object draft, creating the document when absent. args are the owner ID (conversation or task scope), then the family key and seed (families). A family access without a seed fails as upstream's undefined seed does; an explicit nil seed is JSON null.
func (*Transaction) Entry ¶
func (tx *Transaction) Entry(id durable.EntryId) (*durable.EntryRecord, error)
Entry returns the committed entry, or nil.
func (*Transaction) ForkConversation ¶
func (tx *Transaction) ForkConversation(parentConversationId durable.ConversationId, at durable.EntryId, options durable.CreateConversationOptions) (durable.ConversationRecord, error)
ForkConversation creates a history fork at one concrete visible entry.
func (*Transaction) HasTableWrite ¶
func (tx *Transaction) HasTableWrite() bool
HasTableWrite is internal: whether a table write was staged, after which table reads throw ReadAfterWrite (transaction.ts `get hasTableWrite`).
func (*Transaction) LatestEntryId ¶
func (tx *Transaction) LatestEntryId(conversationId durable.ConversationId) (*durable.EntryId, error)
LatestEntryId returns the ID of the newest entry visible from the conversation, known from the Session's commits; nil when it has none.
func (*Transaction) LatestHeadMarker ¶
func (tx *Transaction) LatestHeadMarker(conversationId durable.ConversationId) (*durable.EntryRecord, error)
LatestHeadMarker returns the newest visible entry of the conversation that carries a head, known from the Session's commits.
func (*Transaction) PlaceSubmission ¶
func (tx *Transaction) PlaceSubmission(id durable.SubmissionId, entry durable.EntryId) error
PlaceSubmission places a queued submission at entry; resolved like SettleSubmission.
func (*Transaction) RetireDoc ¶
func (tx *Transaction) RetireDoc(token durable.AnyDocToken, args ...any) error
RetireDoc retires a document; args are the owner ID and family key, without a seed.
func (*Transaction) ScanConversations ¶
func (tx *Transaction) ScanConversations(query durable.ConversationQuery, limit int, cursor durable.Cursor) (durable.Page[durable.ConversationRecord, durable.Cursor], error)
ScanConversations scans committed conversations.
func (*Transaction) ScanEntries ¶
func (tx *Transaction) ScanEntries(query durable.EntryQuery, limit int, cursor durable.Cursor) (durable.Page[durable.EntryRecord, durable.Cursor], error)
ScanEntries scans committed visible entries newest-first.
func (*Transaction) ScanTasks ¶
func (tx *Transaction) ScanTasks(query durable.TaskQuery, limit int, cursor durable.Cursor) (durable.Page[AnyTaskRecord, durable.Cursor], error)
ScanTasks scans committed task records.
func (*Transaction) SetTask ¶
func (tx *Transaction) SetTask(value AnyTaskRecord) error
SetTask replaces one task record completely. Tasks change their own state through their runtime.
func (*Transaction) SettleSubmission ¶
func (tx *Transaction) SettleSubmission(id durable.SubmissionId, settlement durable.SubmissionSettlement) error
SettleSubmission stages a settlement, resolved during assembly against the transaction's latest candidate record, falling back to committed state.
Upstream order: the open check, then the table-write mark, then the JSON copy of the settlement, so a settlement that is not strict JSON still ends the transaction's table reads.
func (*Transaction) StagedConversations ¶
func (tx *Transaction) StagedConversations() []durable.ConversationRecord
StagedConversations returns the conversations this transaction created or forked so far.
func (*Transaction) StagedTasks ¶
func (tx *Transaction) StagedTasks() []AnyTaskRecord
StagedTasks returns the candidate records of the tasks this transaction created or replaced so far.
func (*Transaction) Submission ¶
func (tx *Transaction) Submission(id durable.SubmissionId) (*durable.SubmissionRecord, error)
Submission returns the committed submission record, or nil.
func (*Transaction) SubmissionByRequest ¶
func (tx *Transaction) SubmissionByRequest(conversationId durable.ConversationId, requestId string) (*durable.SubmissionRecord, error)
SubmissionByRequest returns the committed submission with a conversation-scoped request ID, or nil.
func (*Transaction) Task ¶
func (tx *Transaction) Task(id durable.TaskId) (*AnyTaskRecord, error)
Task returns the committed task, or nil.
func (*Transaction) WriteKeys ¶
func (tx *Transaction) WriteKeys() []string
WriteKeys is internal: the keys this commit writes, once settled (and after takeHeld), for the Session's unpublished write set: its table records, and the address and incarnation of every document it creates, changes, or retires, with the scope of every incarnation it creates or retires (transaction.ts writeKeys).
type TransactionScope ¶
type TransactionScope struct {
// ConversationId is the default Tx.CreateTaskErased conversation.
ConversationId *durable.ConversationId
// TaskId is the task whose runtime commit this is; stamped as ByTaskId on appended entries.
TaskId *durable.TaskId
}
TransactionScope holds the defaults a commit binds to.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is the writer of one Session. The line admits each commit as a part once its callback and settlement succeeded; the writer sends every part admitted while no call is in flight as one Commit call, off the line, and publishes the parts of a call one by one, in line order, with a hop between two, so the continuations of the waits one resolves start before the next is published. Held commits are parts without writes, published when the parts before them are.
Each part registers the keys it writes; until it is published, it is the newest unpublished writer of each, and a job that touches one waits for its gate. A key leaves when its newest writer is published, so the map holds one entry per key with an unpublished writer.
func (*Writer) Admit ¶
Admit admits a part: it registers its keys, queues it, and sends it at once unless a call is in flight.
func (*Writer) Drained ¶
func (writer *Writer) Drained() <-chan struct{}
Drained returns a channel closed once every part admitted so far is published or never will be; nil when there is none.
func (*Writer) Gate ¶
Gate returns the gate of the newest unpublished writer of key, or nil when it has none.
func (*Writer) Queued ¶
Queued is the number of admitted parts not yet sent, for tests that wait for what is admitted behind a call in flight.
func (*Writer) Touches ¶
Touches is the number of Gate calls that returned the gate of the newest unpublished writer of key, whoever made them (a job's Touch, a retention probe): for tests that wait until the one caller they expect has reached the wait for that publication; 0 when key has no unpublished writer.
func (*Writer) Unpublished ¶
Unpublished is the number of keys with an unpublished writer, for tests that bound memory.
type WriterHost ¶
type WriterHost interface {
Commit(ctx context.Context, batches [][]durable.StorageWrite, receive func(index int, seq durable.Seq)) (durable.CommitResult, error)
// Stored applies a stored batch to the Session's read caches, right before it is published.
Stored(writes []durable.StorageWrite)
// Publishing runs one part's publication inside the Storage's own scope (Storage.Publishing); it returns nil when the
// publication ran at once, else a channel closed once it ran. Whatever the publication queued for after its scope (the
// dispatch to the host's observers, the waits it woke) has run when the channel is closed or it returned nil.
Publishing(publish func(), ctx context.Context) <-chan struct{}
// Hop returns once what the previous part's publication woke has resumed: the macrotask between two publications.
Hop()
// Failure is the Session's failure, nil when it has not failed.
Failure() error
// Fail fails the Session; at is the line index of the first job whose outcome the failure is, and own the jobs after it
// whose outcome is still their own error (the other parts of a call that rejected), not SessionFailed.
Fail(err error, at int, own []int)
// Report reports an own observer's panic that cannot fail the Session, as it fails with a storage error.
Report(err error, ctx context.Context)
}
WriterHost is what the writer needs of its Session.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sessiontest holds the shared Session test support: a controlled memory storage and an opened Session kernel with its publications.
|
Package sessiontest holds the shared Session test support: a controlled memory storage and an opened Session kernel with its publications. |