updated docs
authorburris <burris>
Tue, 3 Sep 2002 00:37:55 +0000 (00:37 +0000)
committerburris <burris>
Tue, 3 Sep 2002 00:37:55 +0000 (00:37 +0000)
README.txt

index b692979341b316afdecd81cf7ef2f8e5576e01ab..73c365dd18668beab45de491a2da9c78aefe4d47 100644 (file)
@@ -1,9 +1,16 @@
 quick example:
 
-import khashmir, thread
-k = khashmir.Khashmir('127.0.0.1', 4444)
-thread.start_new_thread(k.dispatcher.run, ())
-k.addContact('127.0.0.1', 8080)  # right now we don't do gethostbyname
-k.findCloseNodes()
+>>> import khashmir
+>>> k = khashmir.test_one(4444)  # choose any port
+
+If you want to make another peer in the same session, use peer = khashmir.Khashmir(host, port) then do peer.app.run() to register with the already running thread.
+
+
+>>> k.addContact('127.0.0.1', 8080)  # locate another peer
+>>> k.findCloseNodes()  # query the network to bootstrap our table
+
+Keys are always 20-character strings (sha1 hashes)
+
+>>> k.storeKeyForValue(key, value)  # no callback right now
+>>> k.valueForKey(key, callback)
 
-alternatively, you can call k.dispatcher.runOnce() periodically from whatever thread you choose
\ No newline at end of file