Example #1
0
        public static Future GetFuture(this FlexCacheClient client, RelayMessage message)
        {
            switch (message.GetMessageActionType())
            {
            case MessageActionType.Put:
                return(client.Put(message.GetKeySpace(), message.GetKey(), new MemoryStream(message.Payload.ByteArray), new ContentType(FlexCache.MediaTypeNames.Auto)));

            case MessageActionType.Delete:
                return(client.Delete(message.GetKeySpace(), message.GetKey()));

            case MessageActionType.Get:
                return(client.Get(message.GetKeySpace(), message.GetKey()));
            }

            throw new NotSupportedException("Message type is not supported by Flex Cache.");
        }