bacalhau-project / bacalhau

Compute over Data framework for public, transparent, and optionally verifiable computation
https://docs.bacalhau.org
Apache License 2.0
674 stars 88 forks source link

Separate out streaming client into consumer and producer client and add heart beat logic #4025

Closed udsamani closed 4 months ago

udsamani commented 4 months ago

What is this change about ?

Currently our NATS streaming client does multiple things. On requester node side. it is used as a consumer of log messages coming via NATS and on compute node it acts as write, where it reads logs from appropriate execution engines and puts them as messages on NATS subject.

With this change we go with single responsibility per client and split the client into ConsumerClient and ProducerClient. This makes it easy and each client has single responsibility.

With this change we also add the logic of producer client sending heart beats to consumer client on a heart beat request subject, when a connection is made.