def initEventChannel(self, qmax=0): ''' Create a new channel id and allocate an event Queue. ''' chanid = next(self._ce_chanids) q = e_threads.ChunkQueue() q.chanid = chanid # monkey patch the chanid to the q self._ce_chans.append( q ) self._ce_chanlookup[ chanid ] = q return chanid
def __init__(self): self._ce_chanids = itertools.count() self._ce_fireq = e_threads.ChunkQueue() self._ce_chans = [] self._ce_handlers = collections.defaultdict(list) self._ce_upstreams = [] self._ce_mcastport = None self._ce_mcasthost = None self._ce_ecastsock = None self._ce_chanlookup = {} self._ce_firethr = self._fireFireThread()
def createEventChannel(self, wsname): wsinfo = self._req_wsinfo(wsname) chan = binascii.hexlify(os.urandom(16)) lock, fpath, pevents, users = wsinfo with lock: events = [] events.extend(viv_basicfile.vivEventsFromFile(fpath)) events.extend(pevents) # These must reference the same actual list object... queue = e_threads.ChunkQueue(items=events) users[chan] = queue self.chandict[chan] = [wsinfo, queue] return chan