The Redis bus now uses a pub/sub architecture rather than a simple
queue.
Earlier on, the application could post an event to the queue and then
pick it up when it started listening.
When doing a publish on a pub/sub channel, however, any messages
sent before the client started listening will be lost.
- Use pubsub pattern rather than `rpush`/`blpop` - it saves memory, it's
faster, and it decreases the risk of deadlocks.
- Use a connection pool.
- Propagate `PLATYPUSH_REDIS_QUEUE` environment variable so any
subprocesses can access it.
Also, catch `AttributeError` on `self._proc.terminate` in the
`HttpBackend`, since the process may already have been terminated and
set to null by another worker process.
1. Added documentation to the README on the possible options to run the
Redis service.
2. Show a relevant message to the user if the application is run with
`--start-redis` and Redis couldn't start.
3. Some LINT/black chores on some files that hadn't been touched in a
while.
Reverted the previous retry logic for backend - it didn't really work
This reverts commit 4e0e4863a0.
This reverts commit 964c7b5cf0.
This reverts commit 6ce348365f.
- More consistent naming for many methods, plus added a more extensive doc.
- Refactored the entry points for the daemon and the pusher into two
classes, easier to encapsulate and wrap into tests.
- Removed the local backend - managing the concurrency of two processes
reading and writing on the same socket at the same time was too much,
and its utility outside of the tests (which can have mock backends as
well) is quite modest.
- Managing stop events on the bus. Still some work to do tho.
- Fixed several bugs.