C# Class WebStreams.Server.ControllerRouteExtensions

Extensions to ControllerRoute.
Show file Open project: WebStreams/WebStreams.Server

Public Methods

Method Description
HttpRequestHandler ( this route, object controller, string>.IDictionary args, IOwinContext environment, CancellationToken cancellationToken ) : Task

Returns a handler for incoming Web stream requests.

WebSocketRequestHandler ( this route, object controller, string>.IDictionary args ) : Func,Task>

Returns a handler for incoming Web stream requests.

Private Methods

Method Description
GetIdiomaticHttpRequestHandler ( ControllerRoute route, object controller, string>.IDictionary args ) : Task>.Func

Returns an HTTP request handler for single-return routes.

GetObservableFromHandler ( Func handler ) : IObservable

Returns an observable from the provided handler.

IncomingMessagePump ( WebSocket socket, SingleSubscriptionObservable>.IDictionary observableParams ) : Task

Pumps incoming messages from socket into their corresponding observables.

OutgoingMessagePump ( IObservable outgoing, WebSocket socket ) : Task

Subscribes to the provided outgoing stream, sending all events to the provided socket.

WriteChunkedMessage ( Stream stream, string message, CancellationToken token ) : Task

Writes message to stream and flushes the stream.

Method Details

HttpRequestHandler() public static method

Returns a handler for incoming Web stream requests.
public static HttpRequestHandler ( this route, object controller, string>.IDictionary args, IOwinContext environment, CancellationToken cancellationToken ) : Task
route this /// The handler. ///
controller object /// The controller. ///
args string>.IDictionary /// The request parameters. ///
environment IOwinContext /// The environment. ///
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

WebSocketRequestHandler() public static method

Returns a handler for incoming Web stream requests.
public static WebSocketRequestHandler ( this route, object controller, string>.IDictionary args ) : Func,Task>
route this /// The handler. ///
controller object /// The controller. ///
args string>.IDictionary /// The request parameters. ///
return Func,Task>