April 2020
Intermediate to advanced
292 pages
6h 50m
English
Since this is the first Aggregator, here is the basic shape of one:
| | function createHandlers ({ queries }) { |
| | return { |
| | } |
| | } |
| | |
| | |
| | function createQueries ({ db }) { |
| | return { |
| | } |
| | } |
| | |
| | function build ({ db, messageStore }) { |
| | const queries = createQueries({ db }) |
| | const handlers = createHandlers({ queries }) |
| | return { |
| | queries, |
| | handlers, |
| | } |
| | } |
| | |
| | module.exports = build |
Our Aggregators handle messages, so they have handlers. They also interact with a database, so they have queries. There is a top-level function, which we name build that receives dependencies, namely db and messageStore, references to the database and the Message Store, respectively. ...
Read now
Unlock full access