Start consuming from room servers
()
| 67 | |
| 68 | // Start consuming from room servers |
| 69 | func (s *OutputRoomEventConsumer) Start() error { |
| 70 | return jetstream.JetStreamConsumer( |
| 71 | s.ctx, s.jetstream, s.topic, s.durable, s.onMessage, |
| 72 | nats.DeliverAll(), nats.ManualAck(), |
| 73 | ) |
| 74 | } |
| 75 | |
| 76 | // onMessage is called when the federation server receives a new event from the room server output log. |
| 77 | // It is unsafe to call this with messages for the same room in multiple gorountines |