1
0
mirror of synced 2024-11-05 02:59:16 +00:00

Merge tag '0.9.1' into develop

Fixed NRE with async methods returning a message 0.9.1
This commit is contained in:
Mark van Renswoude 2018-12-21 10:50:44 +01:00
commit 81cc0223cc
2 changed files with 12 additions and 1 deletions

View File

@ -38,6 +38,16 @@ namespace Tapeti.Default
}
// ReSharper disable once UnusedMember.Local - used implicitly above
private static async Task PublishGenericTaskResult<T>(IMessageContext messageContext, object value) where T : class
{
var message = await (Task<T>)value;
if (message != null)
await Reply(message, messageContext);
}
private static Task Reply(object message, IMessageContext messageContext)
{
var publisher = (IInternalPublisher)messageContext.DependencyResolver.Resolve<IPublisher>();

View File

@ -120,9 +120,10 @@ namespace Test
* This will automatically include the correlationId in the response and
* use the replyTo header of the request if provided.
*/
public PoloConfirmationResponseMessage PoloConfirmation(PoloConfirmationRequestMessage message)
public async Task<PoloConfirmationResponseMessage> PoloConfirmation(PoloConfirmationRequestMessage message)
{
Console.WriteLine(">> PoloConfirmation (returning confirmation)");
await Task.Delay(100);
return new PoloConfirmationResponseMessage
{