Class WebSocketWorker
A source worker that pulls events with WebSocket.
public abstract class WebSocketWorker : IDisposable
- Inheritance
-
WebSocketWorker
- Implements
- Inherited Members
Constructors
WebSocketWorker(Uri)
A source worker that pulls events with WebSocket.
protected WebSocketWorker(Uri uri)
Parameters
uriUri
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
Handle(Stream, CancellationToken)
Handles a response.
protected abstract Task Handle(Stream stream, CancellationToken cancellationToken)
Parameters
streamStream- The stream that contains the content of the response.
cancellationTokenCancellationToken- A cancellation token.
Returns
- Task
- The task.
OnError(Exception)
Called when an error occurs.
protected abstract void OnError(Exception ex)
Parameters
exException- The exception.
OnHeartbeat()
Called when a response is received.
protected abstract void OnHeartbeat()
RunAsync(CancellationToken)
Runs the worker.
public Task RunAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken- A cancellation token.
Returns
- Task
- The task.