Hacker News new | ask | show | jobs
by bayesianhorse 3835 days ago
The obvious solution is probably the best: Use an asynchronous framework (like node.js or asyncio) for the REST interface and wait for the completion of the task to return a response.

That process wouldn't handle all the details of the task, but it can wait for notification of the task via other means (celery, rabbitmq, redis, whatever...).

Personally I think REST is the best paradigm for most microservices. There is one exception: Data streams are inherently stateful and some kind of websocket/message passing is a lot more useful in that case.

1 comments

How about batching stuff?
Yup. Batching is why we use queuing.
I am talking about how to send batch requests over REST
Aren't your requests going to be greater than the MTU anyways? Might as well send it whenever unless the work resulting from request processing can also be processed- which sounds like an application protocol.