1

A webhook should return "Ok" as quickly as possible so it is suggested that we somehow queue the hard work for later and just return quickly.

Is it sufficient to just run a "fire and forget" Task in this situation?

Task.Run(() => DoSomething(data);
return Ok();

Does this have any impact if a webhook receives a number of requests at the same time?

levis84
  • 974
  • 1
  • 12
  • 27
  • On the surface there is nothing wrong with this, though if reliability is important I would prefer to use a message queue to run `DoSomething`. That way you can first insert into the message queue and then return OK as a true status response indicating that the hook will be processed. – Cory Nelson Nov 16 '18 at 17:12
  • I should say the "DoSomething()" task is not an intensive task, should only take a few seconds to complete but i feel it should still be set aside somewhere so the webhook can return ASAP. – levis84 Nov 16 '18 at 17:14

0 Answers0