From 682f751ffa431c42c3628fe7796738118dc9252d Mon Sep 17 00:00:00 2001 From: Filip Borkiewicz Date: Fri, 22 Dec 2023 14:54:38 +0100 Subject: [PATCH] Add internal pubsub to README --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f5c1ac2..140e565 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,21 @@ The reasoning is that suddenly seeing tweets for notes that are quite old would be confusing and probably not desired. Additionally there is almost no chance that we will ever manage to post those tweets based on the metrics I am seeing. +### Internal sqlite pub sub + +In order to handle Twitter API errors tweets are scheduled to be sent by publishing them to an internal queue. Think of this in terms of a command bus. + +```mermaid +flowchart TB + process-received-event-handler["ProcessReceivedEventHandler"] + send-tweet-handler["SendTweetHandler"] + tweet-created-event-subscriber["TweetCreatedEventSubscriber"] + + process-received-event-handler --> |pubsub event| tweet-created-event-subscriber + tweet-created-event-subscriber --> |command| send-tweet-handler +``` + + ## Building and running Build the program like so: @@ -222,4 +237,4 @@ used in the following cases: [uber-style-guide]: https://github.com/uber-go/guide/blob/master/style.md -[purplepages]: https://purplepag.es/what \ No newline at end of file +[purplepages]: https://purplepag.es/what