Documentation ¶
Overview ¶
Package redis implements an events.PubSub implementation that uses Redis PubSub.
Example ¶
package main import ( "context" "github.com/aureliar8/ttn-fork/pkg/component" "github.com/aureliar8/ttn-fork/pkg/events" "github.com/aureliar8/ttn-fork/pkg/events/redis" ttnredis "github.com/aureliar8/ttn-fork/pkg/redis" ) func main() { // The task starter is used for automatic re-subscription on failure. taskStarter := component.StartTaskFunc(component.DefaultStartTask) redisPubSub := redis.NewPubSub(context.TODO(), taskStarter, ttnredis.Config{ // Config here... }) // Replace the default pubsub so that we will now publish to Redis. events.SetDefaultPubSub(redisPubSub) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.