Northeastern-Electric-Racing / Argos

Our full-stack data visualization tool
GNU Affero General Public License v3.0
1 stars 0 forks source link

[Scylla] - Add Scylla Metadata Injection #223

Open jr1221 opened 1 month ago

jr1221 commented 1 month ago

Description

Right now, all data addition or expansion is done strictly by the client. Some transformation is done by Calypso but it is very limited in scope. Therefore issues like #207 will continue to be a problem and the end users won't like this.

Acceptance Criteria

This would be the addition of a new thread to Scylla which intercepts and manipulates socket messages before they are sent. This would strictly add new messages or deny others, it should not mutate existing messages. Extensibility for any sort of data manipulation is key, as well as organization and little performance overhead in the mqtt_processor thread.

Requirements for merge:

Proposed Solution

The best way in my view to add this thread is to split the socket from the mqtt processor. Then, switch the mpsc channel to be broadcast type so two such consumer exist, the db Handler and the metadata injector. This metadata injector would then receive every message and manipulate, add messages, etc. It could use tokio select! patterns as seen in other threads to also run periodic tasks. This metadata counting would be hard coded, which is ugly but it's OK.

Depends on #change

Mocks

No response