Skip to content

Commit

Permalink
Expose the underlying session.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias committed Nov 5, 2015
1 parent d5249a5 commit 18099d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject stylefruits/gniazdo "0.4.1-SNAPSHOT"
(defproject org.clojars.tcrawley/gniazdo "0.4.1b"
:description "A WebSocket client for Clojure"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.eclipse.jetty.websocket/websocket-client "9.3.0.RC0"]]
Expand Down
6 changes: 5 additions & 1 deletion src/gniazdo/core.clj
Expand Up @@ -37,7 +37,9 @@
(send-msg [this msg]
"Sends a message (implementing `gniazdo.core/Sendable`) to the given WebSocket.")
(close [this]
"Closes the WebSocket."))
"Closes the WebSocket.")
(session [this]
"Returns the underlying websocket session"))

;; ## WebSocket Helpers

Expand Down Expand Up @@ -135,6 +137,8 @@
(reify Client
(send-msg [_ msg]
(send-to-endpoint msg (.getRemote session)))
(session [_]
session)
(close [_]
(when cleanup
(cleanup))
Expand Down

0 comments on commit 18099d7

Please sign in to comment.