public CallSafeHandle CreateCall(CompletionRegistry registry, CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline) { var result = grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline); result.SetCompletionRegistry(registry); return(result); }
public void WatchConnectivityState(ChannelState lastObservedState, Timespec deadline, CompletionQueueSafeHandle cq, CompletionRegistry completionRegistry, BatchCompletionDelegate callback) { var ctx = BatchContextSafeHandle.Create(); completionRegistry.RegisterBatchCompletion(ctx, callback); Native.grpcsharp_channel_watch_connectivity_state(this, lastObservedState, deadline, cq, ctx); }
/// <summary> /// Create a completion queue that can only be used for Next operations. /// </summary> public static CompletionQueueSafeHandle CreateAsync(CompletionRegistry completionRegistry) { var cq = Native.grpcsharp_completion_queue_create_async(); cq.completionRegistry = completionRegistry; return(cq); }
public static CallSafeHandle Create(ChannelSafeHandle channel, CompletionRegistry registry, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline) { var result = grpcsharp_channel_create_call(channel, cq, method, host, deadline); result.SetCompletionRegistry(registry); return(result); }
public void WatchConnectivityState(ChannelState lastObservedState, Timespec deadline, CompletionQueueSafeHandle cq, CompletionRegistry completionRegistry, BatchCompletionDelegate callback) { var ctx = BatchContextSafeHandle.Create(); completionRegistry.RegisterBatchCompletion(ctx, callback); grpcsharp_channel_watch_connectivity_state(this, lastObservedState, deadline, cq, ctx); }
/// <summary> /// Create a completion queue that can only be used for Next operations. /// </summary> public static CompletionQueueSafeHandle CreateAsync(CompletionRegistry completionRegistry) { var cq = Native.grpcsharp_completion_queue_create_async(); cq.completionRegistry = completionRegistry; cq.shutdownRefcount = new AtomicCounter(1); return(cq); }
/// <summary> /// Creates gRPC environment. /// </summary> private GrpcEnvironment() { GrpcLog.RedirectNativeLogs(Console.Error); grpcsharp_init(); completionRegistry = new CompletionRegistry(); threadPool = new GrpcThreadPool(THREAD_POOL_SIZE); threadPool.Start(); // TODO: use proper logging here Console.WriteLine("GRPC initialized."); }
/// <summary> /// Creates gRPC environment. /// </summary> private GrpcEnvironment() { NativeLogRedirector.Redirect(); grpcsharp_init(); completionRegistry = new CompletionRegistry(this); threadPool = new GrpcThreadPool(this, THREAD_POOL_SIZE); threadPool.Start(); // TODO: use proper logging here Logger.Info("gRPC initialized."); }
private static IReadOnlyCollection <CompletionQueueSafeHandle> CreateCompletionQueueList(GrpcEnvironment environment, int completionQueueCount) { var list = new List <CompletionQueueSafeHandle>(); for (int i = 0; i < completionQueueCount; i++) { var completionRegistry = new CompletionRegistry(environment); list.Add(CompletionQueueSafeHandle.CreateAsync(completionRegistry)); } return(list.AsReadOnly()); }
public CallSafeHandle CreateCall(CompletionRegistry registry, CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CallCredentialsSafeHandle credentials) { using (Profilers.ForCurrentThread().NewScope("ChannelSafeHandle.CreateCall")) { var result = Native.grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline); if (credentials != null) { result.SetCredentials(credentials); } result.Initialize(registry, cq); return(result); } }
public CallSafeHandle CreateCall(CompletionRegistry registry, CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline, CredentialsSafeHandle credentials) { using (Profilers.ForCurrentThread().NewScope("ChannelSafeHandle.CreateCall")) { var result = grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline); if (credentials != null) { result.SetCredentials(credentials); } result.SetCompletionRegistry(registry); return result; } }
public CallSafeHandle CreateCall(CompletionRegistry registry, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline) { var result = grpcsharp_channel_create_call(this, cq, method, host, deadline); result.SetCompletionRegistry(registry); return result; }
private static IReadOnlyCollection<CompletionQueueSafeHandle> CreateCompletionQueueList(GrpcEnvironment environment, int completionQueueCount) { var list = new List<CompletionQueueSafeHandle>(); for (int i = 0; i < completionQueueCount; i++) { var completionRegistry = new CompletionRegistry(environment); list.Add(CompletionQueueSafeHandle.Create(completionRegistry)); } return list.AsReadOnly(); }
public void SetCompletionRegistry(CompletionRegistry completionRegistry) { this.completionRegistry = completionRegistry; }
public void Initialize(CompletionRegistry completionRegistry, CompletionQueueSafeHandle completionQueue) { this.completionRegistry = completionRegistry; this.completionQueue = completionQueue; }
/// <summary> /// Creates gRPC environment. /// </summary> private GrpcEnvironment() { GrpcNativeInit(); completionRegistry = new CompletionRegistry(this); threadPool = new GrpcThreadPool(this, THREAD_POOL_SIZE); threadPool.Start(); }
public static CompletionQueueSafeHandle Create(CompletionRegistry completionRegistry) { var cq = Native.grpcsharp_completion_queue_create(); cq.completionRegistry = completionRegistry; return cq; }
public CallSafeHandle CreateCall(CompletionRegistry registry, CallSafeHandle parentCall, ContextPropagationFlags propagationMask, CompletionQueueSafeHandle cq, string method, string host, Timespec deadline) { var result = grpcsharp_channel_create_call(this, parentCall, propagationMask, cq, method, host, deadline); result.SetCompletionRegistry(registry); return result; }
/// <summary> /// Creates gRPC environment. /// </summary> private GrpcEnvironment() { NativeLogRedirector.Redirect(); GrpcNativeInit(); completionRegistry = new CompletionRegistry(this); threadPool = new GrpcThreadPool(this, _threadPoolSize); threadPool.Start(); }