createStream method
void
createStream({
- required MethodStreamCallContext methodStreamCallContext,
- required UuidValue methodStreamId,
- required Session session,
Implementation
void createStream({
required MethodStreamCallContext methodStreamCallContext,
required UuidValue methodStreamId,
required Session session,
}) async {
var outputStreamContext = await _createOutputController(
methodStreamCallContext,
session,
methodStreamId,
);
var inputStreams = _createInputStreams(
methodStreamCallContext,
methodStreamId,
session,
);
var streamParams = inputStreams.map(
(key, value) => MapEntry(key, value.stream),
);
switch (methodStreamCallContext.method.returnType) {
case MethodStreamReturnType.streamType:
_handleMethodWithStreamReturn(
methodStreamCallContext: methodStreamCallContext,
session: session,
streamParams: streamParams,
outputController: outputStreamContext.controller,
subscription: outputStreamContext.subscription,
methodStreamId: methodStreamId,
);
break;
case MethodStreamReturnType.futureType:
case MethodStreamReturnType.voidType:
await _handleMethodWithFutureReturn(
methodStreamCallContext: methodStreamCallContext,
session: session,
streamParams: streamParams,
outputController: outputStreamContext.controller,
methodStreamId: methodStreamId,
);
break;
}
}