Exemple #1
0
        private void OnHandleCheckAndSet(StoreCommand command)
        {
            var item           = command.Item;
            var commandContext = new CommandContext(command, item);
            var key            = ProcessItemAndBuildKey(commandContext);
            var value          = _formattingServices.Serialize(item.Data, commandContext);
            var casResult      = _memcachedClient.Cas(key, value, command.UniqueID, command.TimeToLive);

            command.SetResult(casResult);
        }
Exemple #2
0
        private void OnHandleStore(StoreCommand storeCommand)
        {
            var item           = storeCommand.Item;
            var commandContext = new CommandContext(storeCommand, item);
            var key            = ProcessItemAndBuildKey(commandContext);
            var value          = _formattingServices.Serialize(item.Data, commandContext);
            var succeded       = _memcachedClient.Store(storeCommand.StoreMode, key, value, storeCommand.TimeToLive);

            storeCommand.SetResult(succeded);
        }