Skip to content

Support "resources" in listening. #75

Description

@izaakschroeder

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()),
  );
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions