|
| virtual | ~Callbacks ()=default |
| | Destroy the callback interface. More...
|
| |
| virtual Expected< void, Error< ErrorCode > > | SetupReceived (const std::shared_ptr< Session > &session, const SetupAttributes &setup_attributes) |
| | Callback on receipt of the peer's SETUP message. More...
|
| |
| virtual void | OnStreamClosed (std::uint64_t stream_id, StreamClosedFlag flag) |
| | Notify that a QUIC stream closed. More...
|
| |
| virtual void | StatusChanged (const std::shared_ptr< Session > &session, Status status) |
| | Callback notification for status/state change. More...
|
| |
| virtual void | MetricsSampled (const std::shared_ptr< Session > &session, const ConnectionMetrics &metrics) |
| | Notification callback to provide sampled connection metrics. More...
|
| |
| virtual Reply< const PublishResponse, PublishErrorCode > | PublishReceived (const std::shared_ptr< Session > &session, std::uint64_t request_id, const PublishAttributes &publish_attributes, std::weak_ptr< SubscribeNamespaceHandler > sub_ns_handler) |
| | Callback notification for new publish received. More...
|
| |
| virtual Reply< void, PublishNamespaceErrorCode > | PublishNamespaceReceived (const std::shared_ptr< Session > &session, const TrackNamespace &track_namespace, const PublishNamespaceAttributes &publish_namespace_attributes) |
| | Callback notification for announce received by subscribe namespace. More...
|
| |
| virtual Reply< const FetchResponse, FetchErrorCode > | StandaloneFetchReceived (const std::shared_ptr< Session > &session, std::uint64_t request_id, const FullTrackName &track_full_name, const StandaloneFetchAttributes &attributes) |
| | Event to run on receiving a Standalone Fetch request. More...
|
| |
| virtual Reply< const FetchResponse, FetchErrorCode > | JoiningFetchReceived (const std::shared_ptr< Session > &session, std::uint64_t request_id, const FullTrackName &track_full_name, const JoiningFetchAttributes &attributes) |
| | Event to run on receiving a Joining Fetch request. More...
|
| |
| virtual Reply< void, FetchErrorCode > | FetchCancelReceived (const std::shared_ptr< Session > &session, std::uint64_t request_id) |
| | Callback notification on receiving a FetchCancel message. More...
|
| |
| virtual Reply< TrackStatusResponse, RequestErrorCode > | TrackStatusReceived (const std::shared_ptr< Session > &session, const FullTrackName &track_full_name) |
| | Callback notification for track status message received. More...
|
| |
Callback interface for session events common to both client and server mode.
Callbacks that answer an inbound request return a Reply, which carries either the response or a reason code for rejecting it. The session sends the protocol message from that reply and correlates it with the request itself, so there is nothing further for the application to call and no request identifier for it to keep.
Return a value to accept, or an Unexpected<Error<E>> holding a reason code, optional reason string, and optional redirect to reject. A Reply<void, E> accepts by returning {}.
An answer that cannot be given straight away is deferred with Reply::Defer(). Its producer is called on the session's message-handling thread and must start, rather than perform, slow work there. When that work completes, invoking the supplied completion callback marshals the response back to the transport notification thread.
Callbacks are invoked on the transport notify thread, which also carries stream and connection events, so an immediate reply must return promptly; anything slow belongs in a deferred one. Each reply is answered exactly once. The transport catches exceptions that escape the producer while it is invoked or the continuation after it is queued; either case can leave the request unanswered until the peer times it out. Exceptions on an application-created worker thread remain the application's responsibility.
A callback that is not overridden keeps its default, given per method below.