-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ftltest supports pubsub #1736
Conversation
} | ||
|
||
type SubscriptionHandle[E any] struct { | ||
Topic *schema.Ref |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TopicHandle and SubscriptionHandle's fields are accessed by ftltest, so have been made public
go-runtime/ftl/ftltest/fake.go
Outdated
fsm: newFakeFSMManager(), | ||
mockMaps: map[uintptr]mapImpl{}, | ||
allowMapCalls: false, | ||
configValues: map[string][]byte{}, | ||
secretValues: map[string][]byte{}, | ||
globalTopic: pubsub.New[pubSubEvent](), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's pull all the pubsub code out into a separate struct and file, and forward to it from fakeFTL.
go-runtime/ftl/ftltest/fake.go
Outdated
defer f.pubSubLock.Unlock() | ||
|
||
logger := log.FromContext(ctx).Scope("pubsub") | ||
results := []SubscriptionResult[E]{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
results := []SubscriptionResult[E]{} | |
var results []SubscriptionResult[E] |
tip: avoids an allocation
google.golang.org/protobuf v1.34.1 // indirect | ||
) | ||
|
||
replace github.com/TBD54566975/ftl => ./../../../../../.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lotta dots
8fb5b5f
to
8bdce7b
Compare
closes #1598
Adds:
func
in the argument)