Skip to content

Conversation

@benjamin-stacks
Copy link

This is another PR I'm splitting out of #6762 since this commit is very self-contained.


The ability to have the event dispatcher not use the database was only used during tests; in actual production, there is always a DB.

Not having to support the DB-less use is going to make it a lot cleaner to use the DB as a (required) queue (see #6543).

This commit also makes the method names and order of operations a little less confusing -- we had send_payload(), send_payload_directly(), send_payload_given_db_path() (ok that one was my fault), and send_payload_with_bytes().

Now we have this instead:

dispatch_to_observer()
-> get_payload_bytes()
-> save_to_db()
-> make_http_request_and_delete_from_db()
   -> make_http_request()
   -> delete_from_db()

Reviewing notes

I've tried to keep the order of the functions in such a way that the diff has as little noise as possible, at least when you hide whitespace, which I strongly suggest).

This ability was only used during tests; in actual production, there is
always a DB.

Not having to support the DB-less use is going to make it a lot cleaner
to use the DB as a queue (see stacks-network#6543).

This commit also makes the method names and order of operations a little
less confusing -- we had `send_payload()`, `send_payload_directly()`,
`send_payload_given_db_path()` (ok that one was my fault),
and `send_payload_with_bytes()`.

Now we have this instead:

```
dispatch_to_observer()
-> get_payload_bytes()
-> save_to_db()
-> make_http_request_and_delete_from_db()
   -> make_http_request()
   -> delete_from_db()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants