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

Support "resources" in listening. #75

Open
izaakschroeder opened this issue Apr 13, 2018 · 0 comments
Open

Support "resources" in listening. #75

izaakschroeder opened this issue Apr 13, 2018 · 0 comments

Comments

@izaakschroeder
Copy link
Contributor

So a lot of times you'd like to have a resource constructed when the server starts listening, use it during the request lifecycle, and then dispose of it when the server shuts down. Being able to return new apps in listening may be able to allow this.

listening(() => {
  const resource = new Thing();
  return compose(
    assign({resource}),
    close(() => resource.dispose()),
  );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant