Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interconecting reSolve to another system

Tags:

resolvejs

I need to connect to an API of another system via a RESTful interface that will be providing events via a websocket connection.

I am using a javascript library to do all the heavy lifting with this other system. I am interested as to the best way to join that system and reSolve.

For example, the other system deals with real-world events and when one these events occurs I want it to feed into reSolve to alter the state.

These events are handled through standard .on handlers.

The inverse is also required, I need to be able to send commands to this other system from reSolve.

My initial thoughts would be in a saga, but I'm unsure if that is the preferred way of doing things.

Thank you for any support you are able to offer.

like image 330
qoole Avatar asked Dec 03 '25 16:12

qoole


1 Answers

As I understand, you have some process that reacts on events in the external system. On these events you can just send a command to reSolve app (a trivial command RECORD_EXTERNAL_EVENT that just stores a payload). Then you can use all other reSolve parts to react on such event within reSolve.

In the inverse scenario - when you send events to an external system - you can create a saga with some kind of "send event" side effect, as Anton suggested.

like image 156
Roman Eremin Avatar answered Dec 08 '25 16:12

Roman Eremin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!