コード例 #1
0
ファイル: filter.py プロジェクト: loic44650/sage-engine
 async def next(self):
     if not self.has_next():
         raise IteratorExhausted()
     mu = await self._source.next()
     while not self._evaluate(mu):
         mu = await self._source.next()
     return mu
コード例 #2
0
 async def next(self):
     """Get the next element from the join"""
     if not self.has_next():
         raise IteratorExhausted()
     if self._currentIter is None or (not self._currentIter.has_next()):
         self._currentBinding = await self._source.next()
         self._currentIter = self._initInnerLoop(self._innerTriple, self._currentBinding)
     return await self._innerLoop()
コード例 #3
0
ファイル: projection.py プロジェクト: loic44650/sage-engine
 async def next(self):
     """
     Get the next item from the iterator, reading from the left source and then the right source
     """
     if not self.has_next():
         raise IteratorExhausted()
     value = await self._source.next()
     if self._values is None:
         return value
     return {k: v for k, v in value.items() if k in self._values}
コード例 #4
0
ファイル: nlj.py プロジェクト: loic44650/sage-engine
 async def next(self):
     """Get the next element from the join"""
     if not self.has_next():
         raise IteratorExhausted()
     cpt = 0
     while self._currentIter is None or (not self._currentIter.has_next()):
         cpt += 1
         self._currentBinding = await self._source.next()
         self._currentIter = self._initInnerLoop(self._innerTriple, self._currentBinding)
         # WARNING: await sleep(0) cost a lot, so we only trigger it every 50 cycle.
         # additionnaly, there may be other call to await sleep(0) in index join in the pipeline.
         if cpt > 50:
             cpt = 0
             await sleep(0)
     return await self._innerLoop()
コード例 #5
0
ファイル: scan.py プロジェクト: loic44650/sage-engine
 async def next(self):
     """Scan the relation and return the next set of solution mappings"""
     if not self.has_next():
         raise IteratorExhausted()
     mappings = selection(next(self._source), self._variables)
     return mappings