Skip to content

support unregistering a service #96

Closed
@weissi

Description

@weissi

In certain cases it could be useful to register and then unregister a service, maybe because that service has been shut down independently for some reason.

Today, this is possible but just forgetting about a registered service (and making the shutdown function do nothing). Unfortunately, that would cause the registration to consume memory forever...

I'd like to see an API like this:

// the return value is usually ignore (`@discardableResult`)
let registrationToken = lifecycle.register(...)
...
lifecycle.unregister(registrationToken, runShutdown: false)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementImprovements to existing feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions