Permalink
Browse files

Added licence details

  • Loading branch information...
waveto committed Jul 7, 2009
1 parent 5f7d122 commit e9608f9e3cce271020cdb4970341826d143c7ff6
Showing with 62 additions and 7 deletions.
  1. +25 −2 demo.js
  2. +11 −4 readme.txt
  3. +26 −1 tyrant.js
View
27 demo.js
@@ -1,3 +1,28 @@
+// demo.js
+//
+// A demo for node-tyrant
+// Version 0.1
+// Rhys Jones, Acknack Ltd 2009
+//
+// Copyright 2009, Acknack Ltd. All rights reserved.
+// 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.
+
var tyrant = require("tyrant.js");
function simpleStoreAndRetreive() {
@@ -57,8 +82,6 @@ function tableDemo(){
}
function runDemo() {
- // Server status
-
tyrant.connect();
tyrant.status(function(s) {
View
@@ -19,12 +19,19 @@ ttserver casket.tcb
Quick Example
+
var tyrant = require("tyrant.js");
-tyrant.put('town', 'Bangor');
-tyrant.get('town', function(value, error) {
- puts('Result '+i+' : '+value);
-});
+function onLoad () {
+ tyrant.connect();
+ tyrant.put('town', 'Bangor');
+ tyrant.get('town', function(value, error) {
+ puts('Result : '+value);
+ });
+ tyrant.quit();
+}
+
+Run demo.js for a more complete demo
View
@@ -1,3 +1,29 @@
+// node-tyrant.js
+//
+// A node.js network inerface for Tokyo Tyrant
+// Version 0.1
+// Rhys Jones, Acknack Ltd 2009
+//
+// Copyright 2009, Acknack Ltd. All rights reserved.
+// 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.
+
+
var conn;
var callbacks=[];
var response=[];
@@ -312,7 +338,6 @@ exports.quit = function() {
if (conn.readyState != "open")
throw "connection is not open";
- //conn.send('quit' + CRLF);
conn.close();
}

0 comments on commit e9608f9

Please sign in to comment.