def cb(self): while True: L, self.buffer = self.buffer.array(), ndeque.Ndeque( elements=self.elements) self.last = self.emit(L) yield self.last yield gen.sleep(self.interval)
def __init__(self, n, e, headings, child): self.n = n self.e = e self.headings = headings #self.buffer = deque(maxlen=n) self.buffer = ndeque.Ndeque(maxlen=n, elements=e, headings=headings) Stream.__init__(self, child)
def cb(self): #pdb.set_trace() while True: L, self.buffer = self.buffer.dataframe(), ndeque.Ndeque( elements=self.elements) self.last = self.emit(L) yield self.last yield gen.sleep(self.interval)
def __init__(self, interval, e, headings, child, loop=None): self.interval = interval self.elements = e self.buffer = ndeque.Ndeque(elements=self.elements) self.last = gen.moment Stream.__init__(self, child, loop=loop) self.loop.add_callback(self.cb)
def __init__(self, n, e, child): self.n = n self.e = e #self.buffer = deque(maxlen=n) self.buffer = ndeque.Ndeque(maxlen=n, elements=e) Stream.__init__(self, child)