Hey hey, I've been working on an HTTP library and ...
# server
f
Hey hey, I've been working on an HTTP library and if you like expressiveness in code, or type safety, it might interest you. I would like some feedback to see if there is any interest at all in stuff like this. I'm interested even in knowing that you don't like it, and it would be so nice to hear why if possible. It was originally developed as an internal tool for a startup years ago, and only recently decided to open source it. https://github.com/memoizr/snitch https://github.com/memoizr/snitch/blob/master/docs/Docs.md
🚀 2
d
Very interesting library! Just a pity that you don't seem to support KotlinX Coroutines... are there any plans for it in the near future?
f
Hey @dave08. I don't mind supporting coroutines or futures actually, so I might well add that if that helps. But I wonder, the code executed in the handler is already running on non blocking threads so I didn't find it an issue to run blocking-style code there. It basically works the same way as Undertow async API (that's what Snitch uses under the hood), which is a really high performance embedded server. But I'm really interested in the use case you have in mind, could you give me an example, even in words, that would make supporting coroutines helpful?
d
Say, supporting async database drivers like r2dbc, non blocking io, or parallel processing in one request to an endpoint, the fact that undertow itself is non blocking opens up receiving lots of parallel requests, but when the processing is intense for a single request then you need to handle that yourself...
That's a big plus for Ktor vs. Http4k...
But you're right that for cases that each request is relatively quick, it might not be much of a difference under standard loads.
f
Yes these are good points. I might add support for it in the next release.
@dave08 I've added support for coroutines. For now it's a separate gradle dependency, but depending on whether there's interest I might go for a deeper and more efficient integration. https://github.com/memoizr/snitch/blob/master/docs/Docs.md#coroutine-support
Any other ideas and suggestions are welcome :)
l
Thank you @flavio for sharing your interesting project! 🙏🏽 Your README documentation inspired me to add a
Show Your Support
section to the Kotools Types library (see commit). 😉
d
Thanks @flavio! When I have smaller microservices to develop, I'll certainly take a look at this!
f
@Loïc Lamarque And I starred it 🙂 great work on that library!
🙏🏽 1
l
Thank you for your support @flavio, it means a lot! 🙏🏽