xpdAcq / rapidz

Fork of Streamz
https://xpdacq.github.io/rapidz
BSD 3-Clause "New" or "Revised" License
5 stars 7 forks source link

unique parallel #38

Open CJ-Wright opened 5 years ago

CJ-Wright commented 5 years ago

This could work? We might need to scatter the list to the executor first?

def f(x, l):
    xr = x.result()
    for y in l:
        if xr == y.result():
            return "~~NULL_COMPUTE~~"
    return xr

def update(x, who=None):
    future = self.executor.submit(f, x, self.list)
    self.list.append(x)
    yield self._emit(future)