void RequestInternal <TResponse, TRequest>(string route, TRequest msg, int timeout, IPitayaSerializer serializer, Action <TResponse> action, Action <PitayaError> errorAction) { _reqUid++; Action <byte[]> responseAction = res => { action(serializer.Decode <TResponse>(res)); }; _eventManager.AddCallBack(_reqUid, responseAction, errorAction); _binding.Request(_client, route, serializer.Encode(msg), _reqUid, timeout); }
private void OnRouteInternal <T>(string route, Action <T> action, IPitayaSerializer serializer) { Action <byte[]> responseAction = res => { action(serializer.Decode <T>(res)); }; _eventManager.AddOnRouteEvent(route, responseAction); }