Last active
April 3, 2020 07:36
-
-
Save thattommyhall/1bda32d40bcfc9b15a14b2029b8d7dc2 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
(ns crossbar-clj.core | |
(:require [promissum.core :as p]) | |
(:import [io.crossbar.autobahn.wamp Session Client])) | |
(defn -main [] | |
(let [wampSession (new Session) | |
wampClient (new Client | |
wampSession | |
"ws://localhost:8080/ws" | |
"realm1" | |
)] | |
#_(.addOnJoinListener wampSession | |
(fn [session, details] | |
(let [callFuture (.call session "my.com.date") | |
] | |
(.whenComplete callFuture (fn [date, throwable] | |
(println date)))))) | |
(.connect wampClient) | |
(Thread/sleep 1000) | |
(println (first (.results (p/await (.call wampSession "my.com.date"))))) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment