public IMsgNThenHttpAdapter Start <TContext>(IHttpApplication <TContext> application, CancellationToken cancellationToken) { if (_msgNThenHttpAdapter != null) { //todo: create MsgNThen core exception throw new Exception("MsgNThenApdapterFactory.Start called more than once."); } _msgNThenHttpAdapter = new MsgNThenHttpAdapter <TContext>(_logger, cancellationToken, application, _messageGroupHandler); return(_msgNThenHttpAdapter); }
public Task StartAsync <TContext>(IHttpApplication <TContext> application, CancellationToken cancellationToken) { _httpAdapter = _apdapterFactory.Start <TContext>(application, cancellationToken); _httpAdapter.Listen(); return(Task.CompletedTask); }