tests + announce notification fix (#193)

This commit is contained in:
tobi 2021-09-04 13:29:56 +02:00 committed by GitHub
commit ff05046df7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 362 additions and 165 deletions

View file

@ -56,6 +56,10 @@ type Processor interface {
Start(ctx context.Context) error
// Stop stops the processor cleanly, finishing handling any remaining messages before closing down.
Stop() error
// ProcessFromClientAPI processes one message coming from the clientAPI channel, and triggers appropriate side effects.
ProcessFromClientAPI(ctx context.Context, clientMsg messages.FromClientAPI) error
// ProcessFromFederator processes one message coming from the federator channel, and triggers appropriate side effects.
ProcessFromFederator(ctx context.Context, federatorMsg messages.FromFederator) error
/*
CLIENT API-FACING PROCESSING FUNCTIONS
@ -290,14 +294,14 @@ func (p *processor) Start(ctx context.Context) error {
case clientMsg := <-p.fromClientAPI:
p.log.Tracef("received message FROM client API: %+v", clientMsg)
go func() {
if err := p.processFromClientAPI(ctx, clientMsg); err != nil {
if err := p.ProcessFromClientAPI(ctx, clientMsg); err != nil {
p.log.Error(err)
}
}()
case federatorMsg := <-p.fromFederator:
p.log.Tracef("received message FROM federator: %+v", federatorMsg)
go func() {
if err := p.processFromFederator(ctx, federatorMsg); err != nil {
if err := p.ProcessFromFederator(ctx, federatorMsg); err != nil {
p.log.Error(err)
}
}()