Giter Site home page Giter Site logo

cacheserver's Introduction

RGCacheServer

RGCacheServer is a ruby cache server based on the especifications of Memcached (http://memcached.org/). It´s a shortened version of the original one, as it only implements it´s fundamental functions.

How it works

  • To get started you should first run the main_server.rb file and then main_client.rb. From then you will start interacting whith the server as the client, via the supported commands that will be described below.

Supported commands

Storage commands
    set: stores the data no matter what
    add: stores the data, only if the server doesn't already hold data for the indicated key
    replace: stores the data, only if the server does already hold data for the indicated key
    append: add the data to an existing key after existing data
    prepend: add the data to an existing key before existing data
    cas: stores the data but only if no one else has updated since the user last fetched it
  • the expected format is the following:
    <command name> <key> <flags> <exptime> <bytes> [noreply]\r\n
  • After this line, the client sends the data block:
    <data block>\r\n
Retrieval commands
    get: retrieves the key, flags, size and data for every sent key
    gets: retrieves the key, flags, size, cas unique id and data for every sent key
  • the expected format is the following:
    <command name> <key>*\r\n

Testing

  • Inside the spec folder there are some files that test cache's primal functionalities.
  • There is also a file named "charge_test.rb" that, when executed, will create 10 clients and will make them interact with the Cache Server for 10 seconds

cacheserver's People

Contributors

rodrigogarcialab avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.