public static void AfterCallback(IntPtr req) { var workreq = PermaRequest.GetObject <WorkRequest>(req); workreq.after(); workreq.Dispose(); }
static public void StaticEnd(IntPtr ptr, int status) { var obj = PermaRequest.GetObject <CallbackPermaRequest>(ptr); if (obj == null) { throw new Exception("Target is null"); } else { obj.End(ptr, status); } }
public void QueueWork(Action callback, Action after) { var pr = new PermaRequest(UV.Sizeof(UvRequestType.UV_WORK)); var before = new CAction <IntPtr>((ptr) => callback()); var cafter = new CAction <IntPtr>((ptr) => { pr.Dispose(); if (after != null) { after(); } }); int r = uv_queue_work(Handle, pr.Handle, before.Callback, cafter.Callback); Ensure.Success(r, this); }
public static void BeforeCallback(IntPtr req) { var workreq = PermaRequest.GetObject <WorkRequest>(req); workreq.before(); }
public static void StaticEnd(IntPtr ptr) { PermaRequest.GetObject <FileSystemRequest>(ptr).End(ptr); }