private async ValueTask <IDispatchResult> InternalDispatchAsync( DispatchDataDictionary dispatchData, bool publish, EndPointAddress endPoint, CancellationToken cancellation) { if (endPoint == await GetLocalEndPointAsync(cancellation)) { var(result, _) = await TryDispatchLocalAsync(dispatchData, publish, allowRouteDescend : true, localDispatch : true, cancellation); return(result); } else { var route = new Route(_typeConversion.SerializeType(dispatchData.MessageType)); var serializedMessage = new Message(); SerializeDispatchData(serializedMessage, dispatchData); var serializedResult = await _messageRouter.RouteAsync(route, serializedMessage, publish, endPoint, cancellation); var result = DeserializeDispatchResult(serializedResult); return(result); } }