bibliopixel.util.server_cache module

class bibliopixel.util.server_cache.ServerCache(constructor, **kwds)[source]

Bases: object

A class that caches servers by key so you don’t keep closing and re-opening the same server and interrupting your connection.

The exact nature of the key depends on the sort of server. For example, for a server socket like SimPixel, it would be just a port number, whereas for a UDP connection like Art-Net, it would be a port, ip_address pair.

close(key)[source]
close_all()[source]
get_server(key, **kwds)[source]

Get a new or existing server for this key.

Parameters:key (int) – key for the server to use
class bibliopixel.util.server_cache.StaticCache[source]

Bases: object

CACHE = None
SERVER_CLASS = None
SERVER_KWDS = {}
classmethod cache()[source]
classmethod close_all()[source]