Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updating package target

  • Loading branch information...
commit add51003922dd8a0829cb745d64534cb8357b12a 2 parents 2d40482 + 9da2786
Jacob Vorreuter authored
Showing with 47 additions and 2 deletions.
  1. +1 −1  Makefile
  2. +39 −0 README.markdown
  3. +7 −1 src/mcerlang.erl
View
2  Makefile
@@ -14,7 +14,7 @@ clean:
rm -rf erl_crash.dump *.beam *.hrl
package: clean
- @mkdir $(PKGNAME)-$(VERSION)/ && cp -rf ebin Makefile README.markdown src support t $(PKGNAME)-$(VERSION)
+ @mkdir $(PKGNAME)-$(VERSION)/ && cp -rf ebin include Makefile README.markdown src support t $(PKGNAME)-$(VERSION)
@COPYFILE_DISABLE=true tar zcf $(PKGNAME)-$(VERSION).tgz $(PKGNAME)-$(VERSION)
@rm -rf $(PKGNAME)-$(VERSION)/
View
39 README.markdown
@@ -12,6 +12,45 @@ Text Protocol Spec <http://code.sixapart.com/svn/memcached/trunk/server/doc/prot
Binary Protocol Spec <http://code.google.com/p/memcached/wiki/MemcacheBinaryProtocol>
+## Quick Start
+
+**You must have the binary protocol branch of memcached running as mentioned above**
+
+ $> make
+ $> make test
+ $> sudo make install
+ $> memcached -d -m 1024 -p 11211 -l localhost
+ $> memcached -d -m 1024 -p 11121 -l localhost
+
+ 1> mcerlang:start_link([{"localhost", 11211, 1}, {"localhost", 11121, 1}]).
+ {ok,<0.37.0>}
+
+ 2> mcerlang:stats().
+ [{{"localhost",11211},
+ [{evictions,"0"},
+ {total_items,"0"},
+ {curr_items,"0"},
+ {bytes,"0"},
+ {...}|...]},
+ {{"localhost",11121},
+ [{evictions,"0"},
+ {total_items,"0"},
+ {curr_items,"0"},
+ {bytes,"0"},
+ {...}|...]}]
+
+ 3> mcerlang:set(hello, <<"World">>).
+ <<>>
+
+ 4> mcerlang:get(hello).
+ <<"World">>
+
+ 5> mcerlang:add("foo", <<"bar">>).
+ <<>>
+
+ 6> mcerlang:get("foo").
+ <<"bar">>
+
## Commands
* **get**(Key::any()) -> Val::binary()
View
8 src/mcerlang.erl
@@ -36,7 +36,7 @@
-export([get/1, get_many/1, add/2, add/3, set/2, set/3,
replace/2, replace/3, delete/1, increment/4, decrement/4,
append/2, prepend/2, stats/0, flush/0, flush/1, quit/0,
- version/0]).
+ version/0, continuum/0]).
-export([find_next_largest/2]).
@@ -108,6 +108,9 @@ quit() ->
version() ->
gen_server:call(?MODULE, version).
+continuum() ->
+ gen_server:call(?MODULE, continuum).
+
%%====================================================================
%% gen_server callbacks
%%====================================================================
@@ -270,6 +273,9 @@ handle_call(version, _From, State) ->
Reply = send_all(State, #request{op_code=?OP_Version}),
{reply, Reply, State};
+handle_call(continuum, _From, State) ->
+ {reply, State#state.continuum, State};
+
handle_call(_, _From, State) -> {reply, {error, invalid_call}, State}.
%%--------------------------------------------------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.