I want to delay the response of my website authentication request so that the server begins responding at a particular seconds offset from when the request was received.
For example, if the user authenticates at 04:00:00
, I want the response to come back at 04:00:05
, not sooner nor later. If it is not possible for the code to meet the deadline, I want it to cause an error.
This must be done on the server side and I would like to avoid using Thread.Sleep
. Though, I was thinking there may be a way to do this with an async controller and using Thread.Sleep in part of the request's continuation
Has anyone here faced a similar challenge and what was your solution?
Can any of you folks think of a way to do this while avoiding Thread.Sleep
and maintaining responsiveness?