Skip to content

feat: add service manager #2985

@vgonkivs

Description

@vgonkivs

Some time ago we discussed with @Wondertan that at some point we'll need some kind of service that can manage our services.
The first use case, that it could handle is simplifying our ServiceBreaker. TLDR: ServiceBreaker wraps some of our services and stops them once BEFP appeared. But it has one disadvantage - each service has to create its pubsub subscription over the BEFP topic. But we can have a service that creates a single subscription, waits for the BEFP, and then stops all respective services. This is only one use case that I can imagine rn, but I'm sure we can find more in the future.

type Service interface {
    Attach(topic string, stop func(context.Context) error) error
    Detach(topic string) error
}

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