Created
January 19, 2012 20:04
-
-
Save sritchie/1642241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defprotocol Connected | |
(connected? [_]) | |
(get-connection [_])) | |
(defn listener [afn space thing] | |
(let [conn-atom (atom nil)] | |
(proxy [elephantdb.common.kryo.Connected Listener] [] | |
(connected? [_] (boolean @conn-atom)) | |
(get-connection [_] | |
@conn-atom) | |
(connected [conn] | |
(reset! conn-atom conn) | |
(.addConnection space thing)) | |
(received [conn obj] | |
(when-not (instance? FrameworkMessage obj) | |
(afn conn obj)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment