public async Task PersistResponseAsync <TResponse>(IDeferredResponse deferredResponse, TResponse response)
    {
        var value = new RedisValue(JsonConvert.SerializeObject(response));

        await _database.StringSetAsync(new RedisKey(deferredResponse.Uri), value);

        await _subscriber.PublishAsync(deferredResponse.Uri, deferredResponse.Uri);
    }
Exemple #2
0
 public DispatchResponse(IDeferredResponse deferredResponse, Task activityTracker)
 {
     DeferredResponse = deferredResponse ?? throw new ArgumentNullException(nameof(deferredResponse));
     ActivityTracker  = activityTracker ?? throw new ArgumentNullException(nameof(activityTracker));
 }
 public async Task <TResponse?> ResolveResponseAsync <TResponse>(IDeferredResponse response)
 => JsonConvert.DeserializeObject <TResponse>((await _database.StringGetAsync(new RedisKey(response.Uri))) is RedisValue value && value.HasValue ? value.ToString() : "");