Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopping contexts #18

Open
aecay opened this issue Jul 9, 2019 · 0 comments
Open

Stopping contexts #18

aecay opened this issue Jul 9, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@aecay
Copy link
Collaborator

aecay commented Jul 9, 2019

We used to have an attribute called should_stop_func on Context objects. In the original implementation, this was always identical to the should_stop of the Runner that created the context. It was removed for being vestigial in #15.

However, we might want to bring this functionality back. To do so properly, as @jb098 pointed out, we should add a settable property to context objects, which journey functions can manipulate.

My question that I think I would need to understand to implement this properly is: what does it mean when a journey stops its context? Should some resources be released? Does the runner need to react in any way? Should it behave differently in any way from just returning from the journey fn and letting the GC take care of the context object?

@aecay aecay mentioned this issue Jul 9, 2019
@aecay aecay added the enhancement New feature or request label Jul 9, 2019
aecay added a commit that referenced this issue Aug 5, 2019
- remove the should_stop_func argument from __init__ (see #18), and the
  should_stop property
- rename self._send to self._send_fn.  Having both self.send and
  self._send was too confusing
- Refactor the context managers to use contextlib.asynccontextmanager.
  This makes the code much shorter and more intelligible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant