Handler.stream constructor

Handler.stream(
  1. String path,
  2. Stream<Map<String, dynamic>> createJsonStream(
    1. RequestContext context,
    2. Map<String, dynamic> body
    )
)

Creates a handler that can be used to handle a request to a Stream<T> Endpoint

Implementation

factory Handler.stream(
    String path,
    Stream<Map<String, dynamic>> Function(
            RequestContext context, Map<String, dynamic> body)
        createJsonStream) {
  return Handler(
    path: path,
    onRequest: eventSourceHandler(createJsonStream: createJsonStream),
  );
}