mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* feat(temporal): optimize send_events workflow calls * feat(tests): udpate tests * fix uninstall connector and missing connector_id * fix connector id not found * fix test time * fix tests * design change for send_events function Co-authored-by: Crimson <[email protected]> --------- Co-authored-by: Crimson <[email protected]>
34 lines
616 B
Go
34 lines
616 B
Go
package activities_test
|
|
|
|
import (
|
|
context "context"
|
|
|
|
"github.com/ThreeDotsLabs/watermill/message"
|
|
)
|
|
|
|
type TestPublisher struct {
|
|
channel chan *message.Message
|
|
}
|
|
|
|
func newTestPublisher() *TestPublisher {
|
|
return &TestPublisher{
|
|
channel: make(chan *message.Message, 100),
|
|
}
|
|
}
|
|
|
|
func (p *TestPublisher) Publish(topic string, messages ...*message.Message) error {
|
|
for _, message := range messages {
|
|
p.channel <- message
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (p *TestPublisher) Close() error {
|
|
close(p.channel)
|
|
return nil
|
|
}
|
|
|
|
func (p *TestPublisher) Subscribe(ctx context.Context) <-chan *message.Message {
|
|
return p.channel
|
|
}
|