Can I make a fully non-blocking backend application with http-kit and core.async?

前端 未结 1 1811
走了就别回头了
走了就别回头了 2021-01-30 07:04

I\'m wondering if it\'s possible to put together a fully non-blocking Clojure backend web application with http-kit.

(Actually any Ring-compatible http server would be f

相关标签:
1条回答
  • 2021-01-30 07:32

    With the async approach you get to send the data to the client when its ready, instead of blocking a thread the whole time its being prepared.

    For http-kit, you should be using an async handler described in the documentation. After delegating the request to an async handler in a proper way, you can implement it however you like using core.async or something else.

    Async Handler documentation is here: http://http-kit.org/server.html#channel

    0 讨论(0)
提交回复
热议问题