Added coloured logs and fixed a concurrency bug in the localpubsub adapter

This commit is contained in:
2024-02-06 18:44:45 -07:00
parent e44c858ab3
commit 53e2254795
10 changed files with 61 additions and 25 deletions

16
lib/pubsub/interface.go Normal file
View File

@ -0,0 +1,16 @@
package pubsub
import "context"
type Message struct {
Payload string
}
type PubSubMessage interface {
ReceiveMessage(ctx context.Context) (*Message, error)
}
type PubSub interface {
SubscribeToChannel(channel string) (PubSubMessage, error)
PublishToChannel(channel string, message string) error
}