-This simple example involves the most basic operations of putting a job in the queue, reserving and deleting it (the code are in `demo.py`):
+The following is an example on how to use the client's API in a program.
+The example show use of the most fundamental operations when using beanstalkd: putting a job in the queue, reserving and deleting it (the code are in `demo.py`):
The client will attempt to automatically re-connect if the socket connection to beanstalkd is closed unexpectedly. In other cases where an error occur, an exception will be passed to the callback function.
+The package also includes a command line client for interacting with beanstalkd directly from the commandline. Here is an example usage corresponding to the code example above:
+Put a job in the default tube (program returns the jid of the new job):
+ > python -m beanstalkt.cmd put "A job to work on"
+Reserved a job from the default tube and delete it:
+ > python -m beanstalkt.cmd reserve delete
+ "body": "A job to work on",
+The documentation is available using the `-h` option, e.g.:
+ > python -m beanstalkt.cmd -h
+ > python -m beanstalkt.cmd put -h
+ > python -m beanstalkt.cmd reserve -h
+All relevant commands are available via the command line client.
A job in beanstalk gets created by a client with the put command. During its life it can be in one of four states:
-Tests are contained in `btc_test.py` and all tests cases can be run by `python bt
+Tests are contained in `btc_test.py` and all tests cases can be run by `python bt_test.py`
The beanstalkd protocol uses YAML for communicating the various stats and lists. The client has a crude YAML parser, suitable only for parsing simple lists and dicts, which eliminates the dependency of a YAML parser.