コード例 #1
0
        public static void AfterCallback(IntPtr req)
        {
            var workreq = PermaRequest.GetObject <WorkRequest>(req);

            workreq.after();
            workreq.Dispose();
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public static void BeforeCallback(IntPtr req)
        {
            var workreq = PermaRequest.GetObject <WorkRequest>(req);

            workreq.before();
        }
コード例 #5
0
 public static void StaticEnd(IntPtr ptr)
 {
     PermaRequest.GetObject <FileSystemRequest>(ptr).End(ptr);
 }