Beispiel #1
0
        public static Task Set(this ISandboxedKeyValueStore keyValueStore,
                               Session session, string key, string value, Moment?expiresAt, CancellationToken cancellationToken = default)
        {
            var command = new SandboxedSetCommand(session, key, value, expiresAt);

            return(keyValueStore.Set(command, cancellationToken));
        }
        public virtual async Task Set(SandboxedSetCommand command, CancellationToken cancellationToken = default)
        {
            if (Computed.IsInvalidating())
            {
                return;
            }
            var keyChecker = await GetKeyChecker(command.Session, cancellationToken).ConfigureAwait(false);

            var expiresAt = command.ExpiresAt;

            keyChecker.CheckKey(command.Key, ref expiresAt);
            await Store.Set(command.Key, command.Value, expiresAt, cancellationToken).ConfigureAwait(false);
        }
Beispiel #3
0
 public Task Set([FromBody] SandboxedSetCommand command, CancellationToken cancellationToken = default)
 => Store.Set(command.UseDefaultSession(SessionResolver), cancellationToken);