Method ReadAsync
- Namespace
- MailFathom.Application.Agent.Conversations
- Assembly
- MailFathom.Application.dll
ReadAsync(AgentConversationId, UserId, AgentConversationHistory, long, int, CancellationToken)
Reads a conversation this person holds, from a stated point.
Task<AgentConversationReading?> ReadAsync(AgentConversationId id, UserId user, AgentConversationHistory history, long afterSequence, int limit, CancellationToken cancellationToken)
Parameters
idAgentConversationIdThe conversation the caller is reading.
userUserIdThe person the caller was admitted for.
historyAgentConversationHistoryWhich reading to return: the visible history a person reads back, or the technical history a turn is composed from, which is all of it.
afterSequencelongThe last place the caller already holds, or
0to read from the beginning.limitintThe greatest number of entries of that reading to return, at most MaximumEntriesPerRead.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<AgentConversationReading>
The conversation's standing and everything after that point, or null where this person has no such conversation.
Remarks
A place this conversation has not reached reads as the beginning rather than as a point to wait at, which is the safe direction: no reader can hold one honestly, so what such a value means is a cursor belonging to some other conversation, and replaying costs a few entries where honouring it would hand back a conversation missing everything before the number. A conversation belonging to somebody else is reported as no such conversation, exactly as one that never existed is.
The visible reading passes over the technical entries rather than returning a page short of them. Both readings share one order, so the places a visible read returns have gaps where tool traffic and summaries stand. The limit counts the entries of the reading asked for, so a page is short only where the history is, an empty page with nothing following is a reader that has caught up, and the last place returned is the cursor to read on from — never a technical entry's, which no visible read hands out.
Exceptions
- ArgumentOutOfRangeException
Thrown when
afterSequenceis negative, whenlimitis outside the bound, or whenhistoryis not a declared member.