private async Task OnEventCoreAsync(EventWrapper wrapper, BasicDeliverEventArgs eventArgs) { var eventRoute = wrapper.Key; if (_handler.TryGetValue(eventRoute, out var list)) { await OnConsumeEvent?.Invoke(eventArgs, wrapper, list); } }
private async Task OnEventCoreAsync(EventWrapper wrapper) { var eventRoute = wrapper.Route; if (_handler.TryGetValue(eventRoute, out var list)) { //var redisEventContext = new RedisEventContext //{ // Key = _key, // EventBus = _redisEventBus, // ServiceProvider = _serviceProvider, // EventRoute = eventRoute, //}; //foreach (var handle in list) //{ // try // { // eventType = handle.GetEventType(); // if (!eventTypeDict.ContainsKey(eventType)) // { // @event = data.Event.ToObject(eventType) as IEvent; // eventTypeDict.Add(eventType, @event); // } // else // { // @event = eventTypeDict[eventType]; // } // await handle.OnEvent(@event, redisEventContext); // } // catch (Exception ex) // { // LogRecord.Error(nameof(InternalRedisEventHandler), $"eventRoute: {eventRoute}, exception: {ex.ToString()}"); // } //} await OnConsumeEvent?.Invoke(wrapper, list); } }
protected override Task OnConsume(ConsumeResult <string, string> result) { OnConsumeEvent.Invoke(result); return(Task.CompletedTask); }