/// <summary> /// Initializes a new instance of the <see cref="CqsHttpListener" /> class. /// </summary> /// <param name="messageProcessor">Used to execute the actual messages.</param> public CqsWebSocketServer(CqsMessageProcessor messageProcessor) { if (messageProcessor == null) { throw new ArgumentNullException("messageProcessor"); } _messageProcessor = messageProcessor; }
/// <summary> /// Initializes a new instance of the <see cref="CqsHttpListener" /> class. /// </summary> /// <param name="messageProcessor">Used to execute the actual messages.</param> public CqsHttpListener(CqsMessageProcessor messageProcessor) { if (messageProcessor == null) { throw new ArgumentNullException("messageProcessor"); } _messageProcessor = messageProcessor; }
public CqsController(IQueryBus queryBus, IRequestReplyBus requestReplyBus, ICommandBus commandBus, IEventBus eventBus) { _cqsProcessor = new CqsMessageProcessor { CommandBus = commandBus, RequestReplyBus = requestReplyBus, EventBus = eventBus, QueryBus = queryBus }; }
private static CqsHttpListener CreateServer() { //can be an ioc bus too. var commandBus = new SimpleCommandBus(); commandBus.Register(Assembly.GetExecutingAssembly()); var queryBus = new SimpleQueryBus(); queryBus.Register(Assembly.GetExecutingAssembly()); //takes care of execution var processor = new CqsMessageProcessor { CommandBus = commandBus, QueryBus = queryBus }; //receive through HTTP var server = new CqsHttpListener(processor); return(server); }
public async Task Try_server_and_client_together_for_queries() { //can be an ioc bus too. var bus = new SimpleQueryBus(); bus.Register(Assembly.GetExecutingAssembly()); //takes care of execution var processor = new CqsMessageProcessor { QueryBus = bus }; //receive through HTTP var server = new CqsHttpListener(processor); server.Map(typeof(GetUsers)); server.Start(new IPEndPoint(IPAddress.Loopback, 0)); //Our cqs HTTP client. var client = new CqsHttpClient("http://localhost:" + server.LocalPort); var result = await client.QueryAsync(new GetUsers { FirstName = "Jonas" }); }
public async Task Try_server_and_client_together() { //can be an ioc bus too. var commandBus = new SimpleCommandBus(); commandBus.Register(Assembly.GetExecutingAssembly()); //takes care of execution var processor = new CqsMessageProcessor { CommandBus = commandBus }; //receive through HTTP var server = new CqsHttpListener(processor); server.Map(typeof(RaiseHands)); server.Start(new IPEndPoint(IPAddress.Loopback, 0)); //Our cqs HTTP client. var client = new CqsHttpClient("http://localhost:" + server.LocalPort); await client.ExecuteAsync(new RaiseHands { Reason = "all YOUR base" }); }
/// <summary> /// Initializes a new instance of the <see cref="CqsHttpListener" /> class. /// </summary> /// <param name="messageProcessor">Used to execute the actual messages.</param> public CqsWebSocketServer(CqsMessageProcessor messageProcessor) { if (messageProcessor == null) throw new ArgumentNullException("messageProcessor"); _messageProcessor = messageProcessor; }
/// <summary> /// Initializes a new instance of the <see cref="CqsHttpListener" /> class. /// </summary> /// <param name="messageProcessor">Used to execute the actual messages.</param> public CqsHttpListener(CqsMessageProcessor messageProcessor) { if (messageProcessor == null) throw new ArgumentNullException("messageProcessor"); _messageProcessor = messageProcessor; }