fixup! wip: refactor: API
This commit is contained in:
parent
e3e469edec
commit
311c100d89
@ -6,8 +6,7 @@ before:
|
|||||||
- go generate ./...
|
- go generate ./...
|
||||||
|
|
||||||
builds:
|
builds:
|
||||||
- main: ./cmd/server
|
- env:
|
||||||
env:
|
|
||||||
# - CGO_ENABLED=0
|
# - CGO_ENABLED=0
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
|
@ -44,6 +44,9 @@ func New(params NewParams) *App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run starts the application, and blocks until it is closed.
|
// Run starts the application, and blocks until it is closed.
|
||||||
|
//
|
||||||
|
// It returns nil if the application was closed by the user, or an error if it
|
||||||
|
// closed for any other reason.
|
||||||
func (a *App) Run(ctx context.Context) error {
|
func (a *App) Run(ctx context.Context) error {
|
||||||
g, ctx := errgroup.WithContext(ctx)
|
g, ctx := errgroup.WithContext(ctx)
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ func (b *Bus) Register() <-chan Event {
|
|||||||
return ch
|
return ch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deregister deregisters a consumer for all events.
|
||||||
func (b *Bus) Deregister(ch <-chan Event) {
|
func (b *Bus) Deregister(ch <-chan Event) {
|
||||||
b.mu.Lock()
|
b.mu.Lock()
|
||||||
defer b.mu.Unlock()
|
defer b.mu.Unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user