Open vicero opened 2 years ago
You can work around it :
do! async {
use x =
{ new IDisposable with
member _.Dispose () =
sender <! (sprintf "disposed-%d" msg)
}
do! Async.Sleep(1)
ctx.Sender() <! msg
}
I was trying to use Serilog to log properties on the ambient context and noticed that none of the properties were being logged. Debugging showed that the Dispose method in Serilog's Enricher was being called almost immediately in an actor that binds to an async computation.
I forked this repo and created a failing test by adding an async binding to an actor that is testing dispose.
I'm not sure of the resolution or I would have included it in the pull request, but I am happy to help in any way I can!