Working with client-side APIs

The client API

The client API lets users write programs that use Bento by providing functions for storing, executing and interacting with a Bento function on a Bento server. All function are apart of a ClientConnection object that connects to a Bento server upon instantiation. See bento/client/api.py
  • send_store_request(name, code): Sends a function's name and code in a store request. Returns the function token sent back by the server.
  • send_execute_request(call, token): Sends a call to a function along with its corresponding token in an execute request. Returns the session id sent back by the server.
  • send_open_request(session_id): Sends an open request with the session_id of an executing function.
  • send_close_request(session_id): Sends a close request with the session_id of an executing function.
  • send_sessionmsg(session_id, data): Sends data to an executing function by specifying a session id.
  • get_sessionmsg(): Gets the latest session message from the server. Returns the data and session id of the message.
Download the source code from Github
Checkout the Bento Poster!