fix: examples

This commit is contained in:
mrkaye97
2025-05-16 14:53:41 -04:00
parent 52336abeb2
commit cbf33d6299
22 changed files with 50 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ func emit(ctx context.Context, startEventsPerSecond, amount int, increase, durat
var err error
ev := Event{CreatedAt: time.Now(), ID: id}
l.Debug().Msgf("pushed event %d", ev.ID)
err = c.Event().Push(context.Background(), "load-test:event", ev)
err = c.Event().Push(context.Background(), "load-test:event", ev, nil, nil)
if err != nil {
panic(fmt.Errorf("error pushing event: %w", err))
}

View File

@@ -26,6 +26,8 @@ func event() {
v1_workflows.SimpleInput{
Message: "Hello, World!",
},
nil,
nil,
)
// !!

View File

@@ -89,6 +89,8 @@ func run() (func() error, error) {
context.Background(),
"user:create:affinity",
testEvent,
nil,
nil,
)
if err != nil {
panic(fmt.Errorf("error pushing event: %w", err))

View File

@@ -111,6 +111,8 @@ func run() (func() error, error) {
context.Background(),
"user:create:sticky",
testEvent,
nil,
nil,
)
if err != nil {
panic(fmt.Errorf("error pushing event: %w", err))

View File

@@ -69,6 +69,8 @@ func run(events chan<- string) (func() error, error) {
context.Background(),
"user:create:cancellation",
testEvent,
nil,
nil,
)
if err != nil {
panic(fmt.Errorf("error pushing event: %w", err))

View File

@@ -141,6 +141,8 @@ func run(events chan<- string) (func() error, error) {
context.Background(),
"user:create:simple",
testEvent,
nil,
nil,
client.WithEventMetadata(map[string]string{
"hello": "world",
}),

View File

@@ -150,6 +150,8 @@ func run(ch <-chan interface{}, events chan<- string) error {
context.Background(),
"user:create:simple",
testEvent,
nil,
nil,
)
if err != nil {

View File

@@ -59,6 +59,8 @@ func main() {
context.Background(),
"example:event",
event,
nil,
nil,
)
if err != nil {

View File

@@ -35,6 +35,8 @@ func main() {
context.Background(),
"user:create",
event,
nil,
nil,
)
if err != nil {

View File

@@ -69,6 +69,8 @@ func main() {
context.Background(),
"user:create",
event,
nil,
nil,
)
if err != nil {

View File

@@ -97,6 +97,8 @@ func main() {
context.Background(),
"user:create",
testEvent,
nil,
nil,
)
if err != nil {

View File

@@ -112,6 +112,8 @@ func main() {
context.Background(),
"user:create",
testEvent,
nil,
nil,
)
if err != nil {

View File

@@ -103,6 +103,8 @@ func run(ch <-chan interface{}, events chan<- string) error {
context.Background(),
"concurrency-test-event",
firstEvent,
nil,
nil,
)
if err != nil {
@@ -123,6 +125,8 @@ func run(ch <-chan interface{}, events chan<- string) error {
concurrencyLimitEvent{
Index: 1,
},
nil,
nil,
)
if err != nil {

View File

@@ -120,7 +120,13 @@ func run(ch <-chan interface{}, events chan<- string) error {
event = concurrencyLimitEvent{1}
}
c.Event().Push(context.Background(), "concurrency-test-event-rr", event)
c.Event().Push(
context.Background(),
"concurrency-test-event-rr",
event,
nil,
nil,
)
}
select {

View File

@@ -109,6 +109,8 @@ func run(events chan<- string) (func() error, error) {
context.Background(),
"user:log:simple",
testEvent,
nil,
nil,
client.WithEventMetadata(map[string]string{
"hello": "world",
}),

View File

@@ -118,6 +118,8 @@ func run(events chan<- string) (func() error, error) {
context.Background(),
"user:create:middleware",
testEvent,
nil,
nil,
)
if err != nil {
panic(fmt.Errorf("error pushing event: %w", err))

View File

@@ -128,6 +128,8 @@ func run(events chan<- string) (func() error, error) {
context.Background(),
"user:create:simple",
testEvent,
nil,
nil,
)
if err != nil {
panic(fmt.Errorf("error pushing event: %w", err))

View File

@@ -136,6 +136,8 @@ func main() {
context.Background(),
"user:create",
testEvent,
nil,
nil,
)
if err != nil {

View File

@@ -118,6 +118,8 @@ func run(ch <-chan interface{}, events chan<- string) error {
context.Background(),
"user:create:simple",
testEvent,
nil,
nil,
)
if err != nil {

View File

@@ -120,6 +120,8 @@ func run(events chan<- string) (func() error, error) {
context.Background(),
"user:create:simple",
testEvent,
nil,
nil,
client.WithEventMetadata(map[string]string{
"hello": "world",
}),

View File

@@ -49,6 +49,8 @@ func run(done chan<- string, job worker.WorkflowJob) (func() error, error) {
context.Background(),
"user:create:timeout",
testEvent,
nil,
nil,
)
if err != nil {
panic(fmt.Errorf("error pushing event: %w", err))

View File

@@ -72,6 +72,8 @@ func run(
context.Background(),
event,
testEvent,
nil,
nil,
)
if err != nil {
return fmt.Errorf("error pushing event: %w", err)