MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Example

Function Example

pkg/events/redis/redis_test.go:64–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64func Example() {
65 // The task starter is used for automatic re-subscription on failure.
66 taskStarter := task.StartTaskFunc(task.DefaultStartTask)
67
68 redisPubSub := redis.NewPubSub(context.TODO(), mockComponent{taskStarter}, config.RedisEvents{
69 // Config here...
70 }, config.BatchEvents{
71 // Batch config here...
72 })
73
74 // Replace the default pubsub so that we will now publish to Redis.
75 events.SetDefaultPubSub(redisPubSub)
76}
77
78var timeout = (1 << 11) * test.Delay
79

Callers

nothing calls this directly

Calls 3

StartTaskFuncFuncType · 0.92
SetDefaultPubSubFunction · 0.92
NewPubSubMethod · 0.80

Tested by

no test coverage detected