Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Add service class interface with helper methods #21

Open
ben-ryder opened this issue Jul 19, 2022 · 0 comments
Open

Add service class interface with helper methods #21

ben-ryder opened this issue Jul 19, 2022 · 0 comments
Assignees
Labels
discovery more information is needed feature New feature or request package/core issues related to @kangojs/core

Comments

@ben-ryder
Copy link
Owner

Package Information: core

Describe your feature
Add a base service class interface which has the methods async onStart() and async onKill(). These are like "hook functions" which KangoJS can call at certain points of the application lifecycle.

  • onStart - called once the application is setup and ready. This could be used for things like starting up cron tasks etc
  • onKill - called when the application is being killed. This can be used for clean up such as closing connections to the database/Redis etc

Is your suggestion related to any problems?
For testing I need to manually fetch all services that require clean up and handle each one.
Having a built in way to handle this would make it easier when multiple services need clean up.

Additional context
n/a

@ben-ryder ben-ryder added discovery more information is needed feature New feature or request package/core issues related to @kangojs/core labels Jul 19, 2022
@ben-ryder ben-ryder self-assigned this Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discovery more information is needed feature New feature or request package/core issues related to @kangojs/core
Projects
None yet
Development

No branches or pull requests

1 participant