public async Task Handle(UpdateCard message, IMessageHandlerContext context) { log.Error($"Received UpdateCard in subscriber, weight = {message.weight} ..."); bool succeded = false; var successedUpdate = await _subscriberService.UpdateCard(message.cardId, message.weight); // var successedUpdate = 1; if (successedUpdate != -1) { succeded = true; AddTrack addTrack = new AddTrack() { CardId = message.cardId, NewWeight = message.weight, }; await context.Send(addTrack); } cardUpdated cardUpdated = new cardUpdated() { isSucceeded = succeded, measureId = message.measureId }; //await _endpointInstance.Send(cardUpdated) await context.Publish(cardUpdated) .ConfigureAwait(false); }
public async Task Handle(UpdateCard message, IMessageHandlerContext context) { _log.Error($"Received UpdateCard in subscriber saga, weight = {message.weight} ..."); UpdateBMI updateBMI = new UpdateBMI() { measureId = message.measureId, cardId = message.cardId, weight = message.weight }; await context.SendLocal(updateBMI); AddTrack addTrack = new AddTrack() { MeasureId = message.measureId, CardId = message.cardId, Weight = message.weight }; await context.Send(addTrack); }
/// <summary> /// 产生了新的媒体轨道 /// </summary> /// <param name="stream"></param> internal void emitAddtrack(MediaStream stream) { AddTrack?.Invoke(stream); }