Open pekhee opened 9 years ago
For what it's worth I really like the message structure here.
Interesting. I wonder if this imposes any restrictions though, such as the ability to stream or use protocols like WebSockets that don't necessarily conform to a structure like this. I don't think you've given enough detail here. I'm not familiar with CouchDB. I need more technical details as I'm still not sure what problem this is solving exactly.
A hypothetical example.
CouchDB gets an HTTP request for creating a new resource. CouchDB as a Rack server queues request in a message queue and waits for a response message.
A Rack compatible worker, say Ruby on Rails, reads message queue and applies some logic. Returns new resource as response.
CouchDB gets the response, stores and returns it as HTTP response.
Possible Approach
Rack can define a message structure and let Rack implementation choose protocol and other details.
Benefits
Notable Mentions