Send bellboy events as requests to the specified server endpoint.
- Requests never fail because of timeout.
- If the server can't be reached, request retries to send an event until success.
These features and the fact that bellboy jobs always wait for the code inside an event listener to complete allow a job to be executed gradually:
- Reporter sends information about an event to the server.
- The server accepts it, but doesn't respond to a request - the job is paused.
- After some time or because of user interaction the server decides to send a response.
- Reporter receives the response, continues the job till the next event and repeats all the steps again.
npm install bellboy-live-reporter
const bellboy = require('bellboy');
const LiveReporter = require('bellboy-live-reporter');
(async () => {
const processor = new bellboy.DynamicProcessor({
generator: async function* () {
for (let i = 0; i < 100; i++) {
yield { hello: `world_${i}` }
}
},
});
const destination = new bellboy.StdoutDestination();
const job = new bellboy.Job(processor, [destination], {
reporters: [
new LiveReporter(),
],
});
await job.run();
})();
option | type | description |
---|---|---|
url | string | Endpoint URL where requests will be sent. If not specified, http://localhost:3041 address is used. |
You can build js
source by using npm run build
command.
Tests can be run by using npm test
command.