[ ] create "enqueue" mutation to enqueue jobs from a client
[ ] create "request_ubi" job description
[ ] create "request_ubi" job worker
[ ] create "request_ubi" notification and route it to a specific client by it's sessionId
[ ] update client logic
Client:
Every client queries the last ubi timestamp from the api
Every client sets a timer that is due 24h after the last ubi
On 'timer due':
every minute while last ubi > 24h:
all clients enqueue a "request_ubi"-job with the following parameters:
Id fields: safeAddress, year, month, day, hour
Payload fields: sessionId
Api:
The api creates one "request_ubi"-worker instance for the first recognized enqueued job with this id
The job worker sends a "request_ubi" notification to the client with the "sessionId" from the payload and waits up to one minute for a corresponding "crc_minting"-event from the blockchain indexer
Success case:
The client requests the ubi
The waiting job worker receives the "crc_minting" event and completes successfully
Client's loop at 3) ends
Client unavailable/UBI not requested case:
The job worker times-out and the corresponding job fails.
Client:
Api:
Success case:
Client unavailable/UBI not requested case: