ExternalInterface<R extends Request, S extends SuccessResponse> constructor
ExternalInterface<R extends Request, S extends SuccessResponse> (
- List<
GatewayConnection< gatewayConnectionsGateway< >DomainModel, Request, SuccessResponse, SuccessDomainInput> >
Implementation
ExternalInterface(List<GatewayConnection<Gateway>> gatewayConnections) {
handleRequest();
for (final connection in gatewayConnections) {
final gateway = connection();
gateway.transport = (request) async {
final req = request as R;
final requestCompleter = gateway is WatcherGateway
? _StreamRequestCompleter<R, S>(req, gateway.yieldResponse)
: _RequestCompleter<R, S>(req);
_requestController.add(requestCompleter);
return requestCompleter.future;
};
}
}