Closed oliverw closed 7 years ago
Yes it is, normal once off running for async handle. There are some cases where you need to worry about closure, I typically do something like this:
asyncHandle = this.loop.CreateAsync(
handle =>
{
var disposible = handle.UserToken as IDisposable;
disposible?.Dispose();
handle.Dispose();
});
asyncHandle.UserToken = tcp; // Save to the handle cookie
asyncHandle.Send();
Thanks for the clarification.
Is it valid to Dispose an Async Handle within its callback like this?:
The purpose of this example is to schedule the disposal of another loop-bound resource on the loop thread.