Skip to content

Shared Connection Object

micramm edited this page Nov 21, 2013 · 10 revisions

Introduction

The shared connection object allows multiple asynchronous clients to share a single connection to the manager. The clients work in their own unique contexts, maintaining complete independence. Additionally, the connection object helps the clients keep track of when a given server disconnects or reconnects to the manager. When such an event occurs, the client can use the connection object to automatically run a certain action like reacquiring the latest data from the server or disabling itself.

How to use

First, the asynchronous client has to important the connection object, and then connect i.e:

from connect import connection

@inlineCallbacks
def initialize(self):
    self.cxn = connection()
    yield self.cxn.connect()

Clone this wiki locally