Skip to content

Instantly share code, notes, and snippets.

View wmayner's full-sized avatar

William Mayner wmayner

View GitHub Profile
@wmayner
wmayner / ray_map_shortcircuit.py
Last active May 11, 2022 19:05
Map a Ray remote function, returning early if a particular value is found
import functools
import time
import ray
ray.init()
def as_completed(object_refs, num_returns=1):