| | 1 | | // AUTOGENERATED, DO NOT EDIT |
| | 2 | | // Type definitions for server implementations of ports. |
| | 3 | | // package: |
| | 4 | | // file: RendererProtocol.proto |
| | 5 | | using System.Collections.Generic; |
| | 6 | | using System.Threading; |
| | 7 | | using Cysharp.Threading.Tasks; |
| | 8 | | using Google.Protobuf; |
| | 9 | | using rpc_csharp.protocol; |
| | 10 | | using rpc_csharp; |
| | 11 | |
|
| | 12 | | public abstract class CRDTService<Context> |
| | 13 | | { |
| | 14 | | public const string ServiceName = "CRDTService"; |
| | 15 | |
|
| | 16 | | public delegate UniTask<CRDTResponse> SendCrdt(CRDTManyMessages request, Context context, CancellationToken ct); |
| | 17 | |
|
| | 18 | | public delegate UniTask<CRDTManyMessages> PullCrdt(PullCRDTRequest request, Context context, CancellationToken ct); |
| | 19 | |
|
| | 20 | | public delegate IEnumerator<CRDTManyMessages> CrdtNotificationStream(CRDTStreamRequest request, Context context); |
| | 21 | |
|
| | 22 | | public static void RegisterService(RpcServerPort<Context> port, SendCrdt sendCrdt, PullCrdt pullCrdt, CrdtNotification |
| | 23 | | { |
| 2 | 24 | | var result = new ServerModuleDefinition<Context>(); |
| | 25 | |
|
| 5 | 26 | | result.definition.Add("SendCrdt", async (payload, context, ct) => { var res = await sendCrdt(CRDTManyMessages.Parser |
| 8 | 27 | | result.definition.Add("PullCrdt", async (payload, context, ct) => { var res = await pullCrdt(PullCRDTRequest.Parser. |
| 2 | 28 | | result.streamDefinition.Add("CrdtNotificationStream", (payload, context) => { return new ProtocolHelpers.StreamEnume |
| | 29 | |
|
| 4 | 30 | | port.RegisterModule(ServiceName, (port) => UniTask.FromResult(result)); |
| 2 | 31 | | } |
| | 32 | | } |