Client sending some request to API We want to process request asynchronously with some throtling and pre-conditions Event examples:
- Listing an item
- Upload image to CDN
- Generate similarity vector
- List on core platform
- Update item
- Pre-condition: item must be listed
- Delete an item
- Pre-condition: item must be listed How could we implement this? What's data model based on example of item listing.
We have defined events and processor
In main class present sequential processing of events
- Pre-condition for event
- Photo upload
- Process only if
state == pending
- Process only if
- Item creation
- Process only if
state == photo_uploaded
OR photo with same name was already uploaded
- Process only if
- Photo upload
- 5 items limit for listing process.