Beispiel #1
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, QueueApiBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_CreateQueue, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.CreateQueueRequest, global::AgQueue.Models.CreateQueueResponse>(serviceImpl.CreateQueue));
     serviceBinder.AddMethod(__Method_InitializeStorage, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.InitializeStorageRequest, global::AgQueue.Models.InitializeStorageResponse>(serviceImpl.InitializeStorage));
     serviceBinder.AddMethod(__Method_DeleteQueueById, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.DeleteQueueByIdRequest, global::AgQueue.Models.DeleteQueueByIdResponse>(serviceImpl.DeleteQueueById));
     serviceBinder.AddMethod(__Method_DeleteQueueByName, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.DeleteQueueByNameRequest, global::AgQueue.Models.DeleteQueueByNameResponse>(serviceImpl.DeleteQueueByName));
     serviceBinder.AddMethod(__Method_GetQueueInfoById, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.GetQueueInfoByIdRequest, global::AgQueue.Models.GetQueueInfoResponse>(serviceImpl.GetQueueInfoById));
     serviceBinder.AddMethod(__Method_GetQueueInfoByName, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.GetQueueInfoByNameRequest, global::AgQueue.Models.GetQueueInfoResponse>(serviceImpl.GetQueueInfoByName));
     serviceBinder.AddMethod(__Method_StartTransaction, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.StartTransactionRequest, global::AgQueue.Models.StartTransactionResponse>(serviceImpl.StartTransaction));
     serviceBinder.AddMethod(__Method_CommitTransaction, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.CommitTransactionRequest, global::AgQueue.Models.CommitTransactionResponse>(serviceImpl.CommitTransaction));
     serviceBinder.AddMethod(__Method_RollbackTranaction, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.RollbackTransactionRequest, global::AgQueue.Models.RollbackTransactionResponse>(serviceImpl.RollbackTranaction));
     serviceBinder.AddMethod(__Method_QueueMessage, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.QueueMessageRequest, global::AgQueue.Models.QueueMessageResponse>(serviceImpl.QueueMessage));
     serviceBinder.AddMethod(__Method_DequeueMessage, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.DequeueMessageRequest, global::AgQueue.Models.DequeueMessageResponse>(serviceImpl.DequeueMessage));
     serviceBinder.AddMethod(__Method_PeekMessageByQueue, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.PeekMessageByQueueRequest, global::AgQueue.Models.PeekMessageByQueueResponse>(serviceImpl.PeekMessageByQueue));
     serviceBinder.AddMethod(__Method_PeekMessageById, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::AgQueue.Models.PeekMessageByIdRequest, global::AgQueue.Models.PeekMessageByIdResponse>(serviceImpl.PeekMessageById));
 }
Beispiel #2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(QueueApiBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_CreateQueue, serviceImpl.CreateQueue)
            .AddMethod(__Method_InitializeStorage, serviceImpl.InitializeStorage)
            .AddMethod(__Method_DeleteQueueById, serviceImpl.DeleteQueueById)
            .AddMethod(__Method_DeleteQueueByName, serviceImpl.DeleteQueueByName)
            .AddMethod(__Method_GetQueueInfoById, serviceImpl.GetQueueInfoById)
            .AddMethod(__Method_GetQueueInfoByName, serviceImpl.GetQueueInfoByName)
            .AddMethod(__Method_StartTransaction, serviceImpl.StartTransaction)
            .AddMethod(__Method_CommitTransaction, serviceImpl.CommitTransaction)
            .AddMethod(__Method_RollbackTranaction, serviceImpl.RollbackTranaction)
            .AddMethod(__Method_QueueMessage, serviceImpl.QueueMessage)
            .AddMethod(__Method_DequeueMessage, serviceImpl.DequeueMessage)
            .AddMethod(__Method_PeekMessageByQueue, serviceImpl.PeekMessageByQueue)
            .AddMethod(__Method_PeekMessageById, serviceImpl.PeekMessageById).Build());
 }