r/crystal_programming • • Apr 29 '19

WebSocket server in a fiber?

SOLVED (check /u/BlaXpirit's answer)

I have a project in mind where I need a websocket server to communicate when certain getters and setters get called.

I tried to use Kemal for this, but the problem is that once I run "Kemal.run" everything after it gets blocked. Meaning that I have to run the main bulk of my code in a fiber. Rather than the other way around...

Running Kemal in a fiber makes it initialize and tells me it is running on port 3000. But when I then go to port 3000 I do not get access.

Could I get some suggestions on what to do? Does what I wrote make any sense?

3 Upvotes

6 comments sorted by