April 2020
Intermediate to advanced
292 pages
6h 50m
English
You’ll write the function for reading messages from a streamhere. It’ll default to reading messages from position 0, but it will accept a fromPosition parameter to let you read from a different position in the stream. Right now is when we use that parameter:
| | function getNextBatchOfMessages () { |
| | return read(streamName, currentPosition + 1, messagesPerTick) |
| | } |
To get the next batch, you just delegate to read using the streamName, currentPosition + 1, and messagesPerTick values—currentPosition + 1 because the Eventide function that queries for the next batch of messages uses >= in the global_position conditional in its WHERE clause:
| | CREATE OR ... |
Read now
Unlock full access