Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create webhook /history_latest #4

Open
4 tasks
IronicUsername opened this issue Dec 11, 2021 · 0 comments
Open
4 tasks

Create webhook /history_latest #4

IronicUsername opened this issue Dec 11, 2021 · 0 comments
Labels
Milestone

Comments

@IronicUsername
Copy link
Owner

IronicUsername commented Dec 11, 2021

Depends on #2, #7

Goal
To continuously serve the most recent entry in the TrashTvArchillectHistory we have to query & send every 5 seconds the latest entry in the table ordered by time descending.

Context
For this issue, we assume, the investigation in #2 and #7 lead to the conclusion GraphQL + Kafka is the way to go.
In order to have something that updates our feed on the frontend, we need a websocket that sends us (ideally every time the table updates we query automatically) the most recent entry in this table sorted by time descending.

Tasks

  • create in api.py the websocket /history_latest which
    • is a GET
    • response is a defaultdict and looks like this:
    {
        "UUID_FROM_TrashTvArchillectHistory": {
            "gif_link": "LINK_TO_GIF",
            "archillect_id": "123",
            "timestamp": datetime(TIMESTAMP_FROM_TrashTvArchillectHistory_TO_GIF)
        }
    }
  • test it (ofc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant