public async Task <Either <string, IProtobufObject> > MakeNotificationSubscribingAsync(string key, IEnumerable <byte> notificationBytes) { var scriptPath = keyScriptMap.GetScriptPathFrom(key); var arg = new ForResponseArgs(notificationBytes); return(await scriptPath.ToAsync().MatchAsync( Some: x => scriptExecutor.RunScriptAsync <IProtobufObject>(x, arg), None: () => $"[Can't Find Key] : {key}")); }
public async Task <Either <string, (IProtobufObject requestProto, IProtobufObject responseProto)> > MakeResponseAsync(string key, IEnumerable <byte> requestBytes) { var scriptPath = keyScriptMap.GetScriptPathFrom(key); var arg = new ForResponseArgs(requestBytes); return(await scriptPath.ToAsync().MatchAsync( Some: x => scriptExecutor.RunScriptAsync <(IProtobufObject requestProto, IProtobufObject responseProto)>(x, arg), None: () => $"[Can't Find Key] : {key}")); }