fixed recursion issue
This commit is contained in:
parent
7bd35dce67
commit
096068367f
@ -100,18 +100,21 @@ class QueueBufferCoupler:
|
||||
self.buffer = buffer
|
||||
|
||||
def __call__(self):
|
||||
return self.compute_next()
|
||||
return first(self.compute_next())
|
||||
|
||||
def compute_next(self):
|
||||
|
||||
item = self.buffer.get_next()
|
||||
while True:
|
||||
item = self.buffer.get_next()
|
||||
|
||||
if item is Nothing:
|
||||
if item is Nothing:
|
||||
|
||||
item = self.queue.popleft()
|
||||
print(">>", item)
|
||||
self.buffer.compute_next(item)
|
||||
return self.compute_next()
|
||||
item = self.queue.popleft()
|
||||
self.buffer.compute_next(item)
|
||||
if item is Nothing:
|
||||
break
|
||||
|
||||
else:
|
||||
yield item
|
||||
|
||||
yield self.buffer.get_next()
|
||||
|
||||
else:
|
||||
return item
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user