public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback) { // TODO(jtattermusch): get rid of new delegate creation here OpCompletionDelegate opCallback = ((success) => HandleRequestCallCompletion(success, ctx, callback)); Register(ctx.Handle, opCallback); }
public void Register(IntPtr key, OpCompletionDelegate callback) { environment.DebugStats.PendingBatchCompletions.Increment(); lock (myLock) { dict.Add(key, callback); this.lastRegisteredKey = key; } }
public void Register(IntPtr key, OpCompletionDelegate callback) { lock (dict) { environment.DebugStats.PendingBatchCompletions.Increment(); GrpcPreconditions.CheckState(!dict.ContainsKey(key)); dict.Add(key, callback); } }
private static void RunCompletionQueueEventCallback(OpCompletionDelegate callback, bool success) { try { callback(success); } catch (Exception e) { Logger.Error(e, "Exception occured while invoking completion delegate"); } }
public OpCompletionDelegate Extract(IntPtr key) { OpCompletionDelegate value = null; lock (myLock) { value = dict[key]; dict.Remove(key); } environment.DebugStats.PendingBatchCompletions.Decrement(); return(value); }
public void NativeCallbackBenchmark() { OpCompletionDelegate handler = Handler; counter = 0; BenchmarkUtil.RunBenchmark( 1000000, 10000000, () => { Native.grpcsharp_test_callback(handler); }); Assert.AreNotEqual(0, counter); }
private void RunCompletionQueueEventCallback(OpCompletionDelegate callback, bool success) { try { callback(success); } catch (Exception e) { Logger.Error(e, "Exception occured while invoking completion delegate"); } finally { queuedContinuationCounter.Decrement(); } }
internal static extern CallError grpcsharp_test_callback([MarshalAs(UnmanagedType.FunctionPtr)] OpCompletionDelegate callback);
public void Register(IntPtr key, OpCompletionDelegate callback) { environment.DebugStats.PendingBatchCompletions.Increment(); GrpcPreconditions.CheckState(dict.TryAdd(key, callback)); }
public void RegisterBatchCompletion(BatchContextSafeHandle ctx, BatchCompletionDelegate callback) { OpCompletionDelegate opCallback = ((success) => HandleBatchCompletion(success, ctx, callback)); Register(ctx.Handle, opCallback); }
public void Register(IntPtr key, OpCompletionDelegate callback) { DebugStats.PendingBatchCompletions.Increment(); Preconditions.CheckState(dict.TryAdd(key, callback)); }
public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback) { OpCompletionDelegate opCallback = ((success) => HandleRequestCallCompletion(success, ctx, callback)); Register(ctx.Handle, opCallback); }
public void Register(IntPtr key, OpCompletionDelegate callback) { environment.DebugStats.PendingBatchCompletions.Increment(); GrpcPreconditions.CheckState(dict.TryAdd(key, callback)); this.lastRegisteredKey = key; }