Refactor Supercollider to have Reload and Fire modes for higher burst emission (#253)
This change refactors Supercollider to support two different modes:
Reload and Fire.
In Reload mode, Supercollider generates a specified number of events as
quickly as it can and writes the CBOR to a file. It uses in-memory
SQLite for the repo manager and I've benched it at around 2.2k evt/sec
for generation.
The static file includes creation of the repos and all the repo appends
for lots of Posts. 2 Million events takes around 16 minutes to produce.
We call this a loaded magazine.
In Fire mode, Supercollider will fire the magazine of events at any
client that connects to the subscribe repos endpoint. Since we're
reading from a file, we can go as fast as the socket can handle, though
we also accept a flag to limit emission rate if we want to for any
reason.
This method allows us to get significantly higher rates (tested at >10k
evt/sec) of event emission for benchmarking a repo stream consumer like
the BGS.
You need to reload between firing only if the consumer has durable repo
state, if you blow away the DB on the consumer between runs, you don't
need to reload since we can play the repos over from creation again
without issue.