Skip to content
New issue

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

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

Already on GitHub? # to your account

Add support for additional client/server adapters #102

Closed
ptaoussanis opened this issue Feb 8, 2015 · 10 comments
Closed

Add support for additional client/server adapters #102

ptaoussanis opened this issue Feb 8, 2015 · 10 comments

Comments

@ptaoussanis
Copy link
Member

ptaoussanis commented Feb 8, 2015

LAST UPDATED: 2023 Mar 7

Sente currently supports #{:clj :cljs :node} servers and #{:cljs :node} clients.

To add support for an additional server, a small adapter needs to be written.
In most cases, the adapter should be pretty easy to write.

See:

Otherwise feel free to ping with any questions. Cheers! :-)

@xfeep
Copy link
Collaborator

xfeep commented Aug 13, 2015

Hi, Taoussanis,
Are implementing these two interface enough?
I found that some codes use keyword :websocket? to check whether a request is a websocket Upgrade request or not, e.g. https://github.com/ptaoussanis/sente/blob/a210107f5a39bc8e33f9402dbd88af72bac1e526/src/taoensso/sente.cljx#L456 .
Does it mean that if a server supports sente it must make sure [:websocket, true] is in its request map if the request is a websocket Upgrade request?

@ptaoussanis
Copy link
Member Author

Hi Zhang,

Does it mean that if a server supports sente it must make sure [:websocket, true] is in its request map if the request is a websocket Upgrade request?

Yes, that is correct.

So a server must implement the two interfaces, and must set :websocket? true in the Ring request map of WebSocket handshake requests.

Thank you for mentioning this, I had forgotten to :-)

@xfeep
Copy link
Collaborator

xfeep commented Aug 23, 2015

Hi, Taoussanis,
In line with sente.cljx#L620, IAsyncNetworkChannel/send!* MUST return true if the channel is not closed before sending.It it right?
Thanks in advance.

@ptaoussanis
Copy link
Member Author

Yes, send! must return:

  • Something truthy if the channel is open when called
  • Something falsey if the channel is closed when called

@ptaoussanis ptaoussanis changed the title Add support for additional [Ring-compatible, async] web servers Add support for additional client/server adapters Mar 30, 2016
@celwell
Copy link

celwell commented Apr 30, 2016

Has anybody tried to write an adapter for Tomcat (8)?

@Frozenlock
Copy link

#80 was closed, but can the JVM server adapters also be used as clients? Much of the client code looks cljs only.

@ptaoussanis
Copy link
Member Author

ptaoussanis commented Sep 30, 2016

Hi there,

#80 was closed to merge the issue with this issue (#102). As described above:

Sente currently supports #{:clj :cljs :node} servers and #{:cljs :node} clients.

I.e. no JVM clients are currently available, but PRs would be welcome. Cheers :-)

@wilkerlucio
Copy link

@ptaoussanis is there any support for Clojure clients? I want to have a Clojure on JVM process connecting to a sente WS process running in node (in an electron app in my case). What's the direction to make this work?

@nha
Copy link

nha commented Apr 5, 2020

@wilkerlucio there is an old PR from @Frozenlock that you may want to have a look at: #275

@ptaoussanis
Copy link
Member Author

Closing to replace with a new issue at #425

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

6 participants