Subscribe to events from Go Cloud.
( ctx context.Context, names []string, ids []*ttnpb.EntityIdentifiers, hdl events.Handler, )
| 130 | |
| 131 | // Subscribe to events from Go Cloud. |
| 132 | func (ps *PubSub) Subscribe( |
| 133 | ctx context.Context, names []string, ids []*ttnpb.EntityIdentifiers, hdl events.Handler, |
| 134 | ) error { |
| 135 | ps.subOnce.Do(func() { |
| 136 | ps.taskStarter.StartTask(&task.Config{ |
| 137 | Context: ps.ctx, |
| 138 | ID: "events_cloud_subscribe", |
| 139 | Func: ps.subscribeTask, |
| 140 | Restart: task.RestartOnFailure, |
| 141 | Backoff: task.DefaultBackoffConfig, |
| 142 | }) |
| 143 | }) |
| 144 | return ps.PubSub.Subscribe(ctx, names, ids, hdl) |
| 145 | } |
| 146 | |
| 147 | func (ps *PubSub) getMetadata(evt events.Event) map[string]string { |
| 148 | ids := make(map[string][]string, 10) |
nothing calls this directly
no test coverage detected