Skip to content

Setup message broker (in test mode) in Python backend  #22

Description

@evinli

This is a pretty hefty task. It involves lifting the two methods setUpRedis() and processDataToRedis() in gamer-gui in the MainViewModel class into our Python backend ground/backend/. It also means you should be pretty familiar with Redis and consumer groups: https://redis.io/docs/latest/develop/connect/insight/tutorials/insight-stream-consumer/.

Here's a general overview of what the message broker class should do:

  • Clear the existing gps_stream, image_stream, and altitude stream on startup
  • (Re)create the above streams if they don't already exist (use xgroupCreate to allow multiple Redis consumer groups)
  • If in test mode, it will try to unpack test images and its metadata (gps, altitude) from the filesystem and add them to separate Redis streams

You will also need to figure out a way to get the timestamp for each data packet (if it doesn't exist, just use the current system time) and set that as the stream entry ID. You can check if everything is added correctly using Redis insight (on localhost:8001) once you've started running the Redis server.

(Entry ID should be timestamp in ms, not whatever we currently have which is shown in this screenshot)
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions