Code Monkey home page Code Monkey logo

nsmemcache's Introduction

 Configuration
 
   nsd.tcl
 
   ns_section    ns/servers/server/modules
   ns_param      nsmemcache    		nsmemcache.so
 
   ns_section    ns/server/module/nsmemcache
   ns_param      server                localhost
   ## If you have more then one server then define it in a new line
   ns_param	 server		       cache

 Usage

   ns_memcache get key dataVar ?lengthVar? ?flagsVar?

   ## This command set the value in a unique key and if key already exists then the old value
   ## replaced with the new one
   ns_memcache set key value ?expires? ?flags?

   ## This command add the value one time and if you 
   ## add again with the same key in your script then it will not be overriden
   ## If you want to override the value of the same key then use replace one 
   ns_memcache add key value ?expires? ?flags?

   ns_memcache replace key value ?expires? ?flags?

   ns_memcache delete key ?expires?

   ns_memcache incr key value ?varname?

   ns_memcache decr key value ?varname?

   ns_memcache version ?ip?

 Authors
 
     Vlad Seryakov [email protected]

 Ported For AOLServer By:
     Majid Khan [email protected]
 Example:

1)
   set check [ns_memcache version "192.168.5.8"]
   print $check

2)
   # store the value for 1 min i.e. 60secs
   ns_memcache set firstkey firstvalue 60

3)
   # Will delete firstkey and then you can define another or add another key instantly
   ns_memcache delete firstkey 

   # But if you delete the firstkey with epxiry then the delted key will be never be added
   # untill the expiry time becomes over.
   # firstkey can only be set after 1 min not before then that
   ns_memcache delete firstkey 60

4)
   # The below will increment the value 3 to what our the value of the key is in the memory 
   ns_memcache incr firstkey 3

5) This one is incomplete one... :( 
   # The below will increment the value 3 to what our the value of the key is in the memory
   ns_memcache decr firstkey


6)
   # Replace the key value with the new one
   # but the value should be set in the memmory first see above the seond example
   ns_memcache replace key value

nsmemcache's People

Contributors

dossy avatar

Watchers

 avatar Goss Nuzzo-Jones avatar Terrence Turner avatar Gregory Ramsperger avatar Daniel Mueller avatar James Cloos avatar  avatar Casey Wahlen 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.