This PR adds the ability to batch and send multiple events at once to a session using event buffers.
Example usage:
session.batch((batched) => {
for (let i = 0; i < 100; ++i) {
batched.push(`Event no. ${i}`);
}
});
Using the exact same helpers as you would with Session (push, iterate and stream) you can batch together many events and then send all them in a single transmission.
This is more significantly more performant and uses less network bandwidth overall, and is a necessary precursor to implementing the event history API.
Resolves #42.
This PR adds the ability to batch and send multiple events at once to a session using event buffers.
Example usage:
Using the exact same helpers as you would with
Session
(push
,iterate
andstream
) you can batch together many events and then send all them in a single transmission.This is more significantly more performant and uses less network bandwidth overall, and is a necessary precursor to implementing the event history API.
See the API documentation for more.