Closed EvanKirshenbaum closed 10 months ago
This issue was referenced by the following commit before migration:
While I was there, I also changed Trigger
to keep a list of callbacks rather than a list of object/future pairs, since it makes more sense to turn (val, future)
into lambda: future.post(val)
than to create a Postable[None]
and hang calling the callback off of it.
The
Barrier
class is currently defined asBarrier[T]
:None of its state, however, is dependent on its generic parameter
T
, and theval
parameter to.pass_through()
is essentially ignored, so it could probably be more simply defined as something likeT
would still be used in.reach()
(optinally) and.pause()
to ensure that the value was something passable to the future, but you could mix and match. Essentially,would simply be shorthand for
(except that it would bind the values rather than referring to the variables.)
This will help with barriers in DML (#284) since otherwise I'll either have to make them a meta-type or they'd have to be
Barrier[Any]
inside, and that would require the future to be aPostable[Any]
, which would get messy.Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 03, 2023 at 5:42 PM PDT. Closed on Jul 05, 2023 at 10:38 AM PDT.