Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

license file and readme updates

  • Loading branch information...
commit 727898f52213f1b0b80d71633ce90970dd210dad 1 parent 33693e8
@yfinkelstein authored
Showing with 42 additions and 18 deletions.
  1. +19 −0 LICENSE-MIT.txt
  2. +15 −6 README.md
  3. +8 −12 test/zk_test_shootout_promise.js
View
19 LICENSE-MIT.txt
@@ -0,0 +1,19 @@
+Copyright 2010 Yuri Finkelstein <yurif2003 at yahoo dot com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
View
21 README.md
@@ -54,6 +54,9 @@ The following API calls closely follow ZK C API call. So, consult with ZK Refere
* a_set
* a_delete_
+Session state machine is well described in Zookeeper docs, i.e.
+![here](http://hadoop.apache.org/zookeeper/docs/r3.3.1/images/state_dia.jpg "State Diagram")
+
Random notes on implementation
------------------------------
@@ -110,8 +113,8 @@ Dependencies:
* zookeeper version 3.3.1
* zookeeper native client should be installed in your system:
**cd $ZK_HOME/src/c && configure && make && make install**
-this puts *.h files under /usr/local/include/c-client-src/ and lib files in /usr/local/lib/libzookeeper_*
-
+this puts *.h files under /usr/local/include/c-client-src/ and lib files in /usr/local/lib/libzookeeper_*
+The build process is described in details [here](http://hadoop.apache.org/zookeeper/docs/r3.3.1/zookeeperProgrammers.html#C+Binding "C")
Build
-----
@@ -135,15 +138,21 @@ This is the first version of the client. It works for me flawlessly though :)
SEE ALSO
--------
-- http://hadoop.apache.org/zookeeper/releases.html
-- http://hadoop.apache.org/zookeeper/docs/r3.3.1/zookeeperProgrammers.html#ZooKeeper+C+client+API
-- http://github.com/kriszyp/node-promise
-- http://github.com/pgriess/node-webworker
+- [http://hadoop.apache.org/zookeeper/releases.html](http://hadoop.apache.org/zookeeper/releases.html)
+- [http://hadoop.apache.org/zookeeper/docs/r3.3.1/zookeeperProgrammers.html#ZooKeeper+C+client+API](http://hadoop.apache.org/zookeeper/docs/r3.3.1/zookeeperProgrammers.html#ZooKeeper+C+client+API)
+- [http://github.com/kriszyp/node-promise](http://github.com/kriszyp/node-promise)
+- [http://github.com/pgriess/node-webworker](http://github.com/pgriess/node-webworker)
+
Acknowledgments
---------------
- **node-promise by kriszyp** is a fantastic tool imho. I wish it was distributed as a module so that I could easily 'require' it rather then
resort to distribution by copy.
+- **node-webworker by pgriess** is used to spawn multiple ZK workers in one of the tests.
+LICENSE
+-------
+
+See LICENSE-MIT.txt file in the top level folder.
AUTHOR
------
View
20 test/zk_test_shootout_promise.js
@@ -89,18 +89,14 @@ function Game (game_number, base_path) {
var Shoot = function () {
console.log ("====>player %s says: I made %d shots, he made %s shots", context.name, context.my_shots, context.his_shots);
- //console.trace ("IN SHOOT")
- setTimeout (
- function () {
- console.log ("player %s is about to attack", context.name);
- zk.create (context.other_gate + "/attack", "kick", ZK.ZOO_SEQUENCE | ZK.ZOO_EPHEMERAL).then (
- function (created_node) {
- console.log ("player %s attacked with %s", context.name, created_node);
- context.my_shots ++;
- Shoot ();
- }
- )
- }, 0);
+ console.log ("player %s is about to attack", context.name);
+ zk.create (context.other_gate + "/attack", "kick", ZK.ZOO_SEQUENCE | ZK.ZOO_EPHEMERAL).then (
+ function (created_node) {
+ console.log ("player %s attacked with %s", context.name, created_node);
+ context.my_shots ++;
+ Shoot ();
+ }
+ )
};
var Defend = function () {
Please sign in to comment.
Something went wrong with that request. Please try again.