NewScope() public method

Creates a new usage scope for this completion queue. Once successfully created, the completion queue won't be shutdown before scope.Dispose() is called.
public NewScope ( ) : UsageScope
return UsageScope
Example #1
0
 public void StartUnary(IUnaryResponseClientCallback callback, SliceBufferSafeHandle payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags)
 {
     using (completionQueue.NewScope())
     {
         var ctx = completionQueue.CompletionRegistry.RegisterBatchCompletion(CompletionHandler_IUnaryResponseClientCallback, callback);
         Native.grpcsharp_call_start_unary(this, ctx, payload, writeFlags, metadataArray, callFlags)
         .CheckOk();
     }
 }
Example #2
0
 public void StartUnary(UnaryResponseClientHandler callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags)
 {
     using (completionQueue.NewScope())
     {
         var ctx = BatchContextSafeHandle.Create();
         completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success, context.GetReceivedStatusOnClient(), context.GetReceivedMessage(), context.GetReceivedInitialMetadata()));
         Native.grpcsharp_call_start_unary(this, ctx, payload, new UIntPtr((ulong)payload.Length), writeFlags, metadataArray, callFlags)
         .CheckOk();
     }
 }
Example #3
0
 public void StartUnary(IUnaryResponseClientCallback callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags)
 {
     using (completionQueue.NewScope())
     {
         var ctx = BatchContextSafeHandle.Create();
         completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_IUnaryResponseClientCallback, callback);
         Native.grpcsharp_call_start_unary(this, ctx, payload, new UIntPtr((ulong)payload.Length), writeFlags, metadataArray, callFlags)
         .CheckOk();
     }
 }