public void AsyncCanBeSent() { var loop = new UvLoopHandle(_logger); loop.Init(_uv); var trigger = new UvAsyncHandle(_logger); var called = false; trigger.Init(loop, () => { called = true; trigger.Dispose(); }, (a, b) => { }); trigger.Send(); loop.Run(); loop.Dispose(); Assert.True(called); }
private void RunLoop() { Uv = new Uv(); Loop = new UvLoopHandle(); Loop.Init(Uv); _postHandle = new UvAsyncHandle(); _postHandle.Init(Loop, OnPost, null); _running.Set(); Uv.run(Loop, 0); _postHandle.Reference(); _postHandle.Dispose(); Uv.run(Loop, 0); Loop.Dispose(); }