17
loading...
This website collects cookies to deliver better user experience
[ user(U) ]<------+
| |
| action(A) |
v |
[ receiver (R)] ^ world
| | change
| |
v |
[ state (S) ] ----+
receiver:
this is usually a backend endpoint
user:
in our case is a chef
state:
in our case: creating an order
a) consumer of 'order.new'
a) consumer of 'order.created'
b) consumer 'order.created'
c) consumer 'order.created'
d) consumer 'order.created'
e) consumer 'order.created'
a) consumer of 'message.created'
a) consumer of 'email.created'
a) consumer of 'email.sent'
begin
insert the order
insert the message (push_notification_sent_at = null)
insert the email (sent_at = null, delivered_at = null)
insert log
commit
select (for update) messages where push_notification_sent_at is null
send the push notification
update the message
select (for update) email where sent_at is null
send the email
update the email table
17