Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Socket.io Scala client

I'm looking for a socket.io client for Scala. I'm well aware of this, but I cringe at the idea of using it in Scala as it wouldn't feel quite natural nor would it allow for an idiomatic implementation. Does any of you, thus, have a suggestion as to where could I find a Scala client?

If so, just the lines for SBT and a link to the doc will suffice as an answer ;)

like image 289
em70 Avatar asked Nov 14 '22 07:11

em70


1 Answers

I'm afraid I don't know any already implemented libraries or apparent solutions for Scala. But I'll present two very simple approaches that should be very easy to use if you have the time to DIY :-)

But of course it really depends on what you want. As you probably already could imagine a plain WebSocket implementation of Java's standard library can be quite efficient if you need to process simple requests. I found one at scala-lang.org implementing a server calculating random numbers. If it is of interest there's also something brewing at the nightly build which might reveal some handy tricks.

If you want to go for simplicity and for pure Scala in all its might the Actors (in particular a RemoteActor) are immensly powerful. It requires Scala on both ends naturally, but it gives you a messaging-system almost instantly. This is a pretty good start-guide if you aren't already familiar with them.

Anyway. If no good library surfaces I hope this helped. Good luck.

like image 60
Jens Egholm Avatar answered Dec 19 '22 22:12

Jens Egholm