我想写一个能做某事的函数,然后在返回之前触发一个30分钟后完成的函数。我不想等待30分钟,直到另一个函数完成从main函数返回一些东西,该怎么做?
[HttpPost]
public async Task<HttpResponseMessage> CreateEvent(FormDataCollection formData)
{
//do something
asyncFunction(30) - function to be done after 30 minutes (this function will probably have to have Thread.Sleep or something, not sure)
return new HttpResponseMessage(HttpStatusCode.OK);
}
有可能吗?我不想等asyncFunction
来返回HttpStatusCode
。