Skip to content
dustismo edited this page Apr 13, 2011 · 11 revisions
  • PyStrest - Official Python driver
  • JavaStrest - Official Java driver (part of the java-oss-lib)
  • JsStrest - Official Javascript driver (for use with STREST on websockets)

Rules for client drivers

All clientside drivers MUST implement the following asynchronous method (in a language appropriate way)

send_request(request, response_callback, txn_complete_callback, error_callback)

All other functionality should be built around this single method. The send_request method should also check that the request contains a valid Strest-Txn-Id header, if not it should automatically generate one. It is recommended to also set the User-Agent header appropriately. send_request should be properly threadsafe

Upon receiving a response for a specific transaction the callbacks should be called in this order:

  • response_callback
  • txn_complete_callback (if the Strest-Txn-Status header is 'complete')

error_callback should be used to handle transport problems, not error codes sent from the server. In most cases error_callback should only be called when the client is disconnected.

Clone this wiki locally