session

Establish a connection with the remote BeeCluster server.

import beecluster
session = beecluster.session(
appID = "ABC123",
BeeClusterControlEndpoint = "http://127.0.0.1:8008",
BeeClusterDroneEndpoint = "http://127.0.0.1:8009"
)

Parameters

NameDescription
appIDThe ID of the application. BeeCluster uses this ID to distinguish different applications. The dynamic task graphs of an application with ID=appID are stored in the /data/appID folder.
BeeCluster(Control/Drone)EndpointThe HTTP endpoints of the server. These two endpoints will be merged into one in a newer version.

Return

This function establishes the connection to the BeeCluster server and returns a session object. Most of the other functions are implemented as member functions of this session object.

Remark

The returned session object needs to be closed explicitly if you create the session using the following coding style.

sess = beecluster.session()
# do your tasks with sess ...
sess.close() # close the connection to the remote server

The returned session object is closed implicitly if you create the session with python's 'with' statement. For example:

with beecluster.session() as sess:
# do your tasks with sess ...
# the sess object is closed