Simple typescript Example
Sorry to be a pain... Ive been trying to do this on my own and am failing...
First off, I'd like to use typescript. Its somewhat working.
Second, and correct me if I'm not using the library correctly, let me explain what I THINK that I would like it to do..
I would like to have a couple different services run, that all use this exchange to pass messages back and forth. It looks like I need to create new classes for each of the different "services" that I am trying to recreate..
Lets say for example, I want to have a service that does CRUD on a users profile, 1 that does CRUD on an "Orders" table, and 1 that listens for events emitted to it, from another service, to then update some data in a database and also emit it out to some clients.
In express, I would do the majority of this work inside a controller per service, and then assign "routes" to them, to split up the code.
Sorry again for long winded question. Here is my understanding from another post:
The cluster has 1 worker, which can scale. Great. You mentioned that we can require (and I would assume import), code to break up the complexity of any 1 file.
I would then think that, in each sub-worker, if you will, I could subscribe to events emitted within the system, and then it would do some unit of work (save to database and then emit something else out)
What class should I extend to get access to the events in each of my sub-workers?
Thanks for the help.