ai pubsub
Some checks failed
Build and Publish / BuildAndDeployArm64 (push) Failing after 16s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 1m1s

This commit is contained in:
matst80
2025-11-18 22:48:18 +01:00
parent 7fd6b22c6b
commit a7aab5161b
5 changed files with 161 additions and 1 deletions

View File

@@ -127,6 +127,13 @@ func main() {
log.Fatalf("Error creating cart pool: %v\n", err)
}
pool.SetPubSub(actor.NewPubSub(func(id uint64, event actor.Event) {
grain, _ := pool.Get(context.Background(), id)
if sub, ok := any(grain).(actor.Subscribable); ok {
sub.Notify(event)
}
}))
klarnaClient := NewKlarnaClient(KlarnaPlaygroundUrl, os.Getenv("KLARNA_API_USERNAME"), os.Getenv("KLARNA_API_PASSWORD"))
rdb := redis.NewClient(&redis.Options{
Addr: redisAddress,