Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocket support? #79

Open
zcaudate opened this issue Aug 18, 2019 · 11 comments
Open

websocket support? #79

zcaudate opened this issue Aug 18, 2019 · 11 comments

Comments

@zcaudate
Copy link

does coast have/intend to have web socket support?

@swlkr
Copy link
Member

swlkr commented Aug 18, 2019

it is a goal, yeah i want something like actioncable

@zcaudate
Copy link
Author

If you'd like some help with this, I'd be happy to participate.

@swlkr
Copy link
Member

swlkr commented Aug 19, 2019

yeah definitely! i’m kind of following #77

today i took a detour trying to get graal working with the framework and it did work, but unfortunately the sqlite jdbc JNI stuff doesn’t work in graal 😐

but yeah anything you want to take a stab at, just throw up a repo for it or if you need to modify coast itself that’s fine too, i’ll add you to the coast-framework org

@zcaudate
Copy link
Author

I'm really impressed with how the routing has been designed, would you have any ideas of how the websockets api might work? I found sente a little bit too heavy but it's got some pretty cool ideas.

Also, is the default server adapter http-kit?

@swlkr
Copy link
Member

swlkr commented Aug 19, 2019

Hey thanks! The routing is super simple, how routing should be, really.

The default server adapter is http-kit, I don't even have support for another one, although I suppose you could just use the app since it's ring and just pass it to a different server.

It would be cool if there was some built in graal native-image compatible way to switch the default server similar to jdbc switching db providers. I think they just call Class.forName which is supported by native-image.

@zcaudate
Copy link
Author

http-kit has a pretty decent websocket implementation. I'm using immutant at the moment which uses undertow underneath. The websocket calls are similar but may need some abstraction if you want to support multiple adapters.

I'm not really sure with the graal thing. It'd be great but startup time is not really a pain right now for me.

@swlkr
Copy link
Member

swlkr commented Aug 20, 2019

I only mention graal because I want to run as many coast apps as I can on a $5 VPS, and the native-image testing I've done takes up way less memory than the equivalent jvm.

This is also why I fork certain things or don't use ring-defaults, because I needed better control over random requires and unsupported reflection.

The good news is, the new version of coast in the next branch DOES work compiled as a native-image and if paired with postgres, even the db stuff works, which is really cool, h/t to yogthos' graal example web server repo

@zcaudate
Copy link
Author

I've had a play with the example. it's nice. I'll see if I can get a websocket example working in the next week.

@rawoke083
Copy link

Any update or examples maybe of this ? Would love to use coast since it seems to be the "most complete clojure framework" that just works ! I lost two days trying to get a basic websocket+lein app up !
HTTP-Kit is horrendous mess

@swlkr
Copy link
Member

swlkr commented Jul 7, 2022

I don't really have any updates, haven't been doing much clojure (or lisp in general) stuff lately, but if you're motivated feel free to take a crack at it!

@rawoke083
Copy link

I don't really have any updates, haven't been doing much clojure (or lisp in general) stuff lately, but if you're motivated feel free to take a crack at it!

But then It won't have your flair or completeness :P

haven't been doing much clojure
I starting to see(guess ?) why, I've been bumping my head in clojure land trying to find a working example of a web-app with routing, async and sse.

Most of the libraries, examples or docs of the projects are years out of date or has these cryptic snippets of code (no filenames to snippets) with no luck of getting a end-to-end example working for the newbie.

So far "Coast" has been the most complete, unified, beautiful and more importantly up to date framework/server I've encounter.

I have high-hopes for Janet and Joy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants