Skip to content

Support "resources" in listening. #75

@izaakschroeder

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

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