Skip to content

Instantly share code, notes, and snippets.

import org.vertx.java.core.Handler;
import org.vertx.java.core.AsyncResult;
import org.vertx.java.core.AsyncResultHandler;
import org.vertx.java.core.datagram.DatagramPacket;
import org.vertx.java.core.datagram.DatagramSocket;
import org.vertx.java.core.datagram.InternetProtocolFamily;
import org.vertx.java.platform.Verticle;
import org.vertx.java.core.buffer.Buffer;
import java.util.concurrent.atomic.AtomicInteger;
diff --git a/vertx-testsuite/src/test/java/vertx/tests/core/datagram/TestClient.java b/vertx-testsuite/src/test/java/vertx/tests/core/datagram/TestClient.java
index dcbac0c..953dc2d 100644
--- a/vertx-testsuite/src/test/java/vertx/tests/core/datagram/TestClient.java
+++ b/vertx-testsuite/src/test/java/vertx/tests/core/datagram/TestClient.java
@@ -29,6 +29,7 @@ import org.vertx.java.testframework.TestUtils;
import java.net.*;
import java.util.Enumeration;
import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
(defun nrepl-port-from-file (file)
"Attempts to read port from a file named by FILE."
(let* ((dir (nrepl-project-directory-for (nrepl-current-dir)))
(f (expand-file-name file dir)))
(when (file-exists-p f)
(with-temp-buffer
(insert-file-contents f)
(buffer-string)))))
(defun nrepl-default-port ()
tcrawley soft nofile 16384
tcrawley hard nofile 16384
tcrawley soft nproc 4096
tcrawley hard nproc 4096
(import '[java.nio.file Path Files FileSystem FileSystems StandardCopyOption FileVisitor FileVisitResult])
(defn ->path [path]
(if (instance? Path path)
path
(.getPath (FileSystems/getDefault) path (into-array String []))))
(defn copy [from to]
(Files/copy (->path from) (->path to) (into-array [StandardCopyOption/COPY_ATTRIBUTES])))
(defn make-isolated-conf []
(let [conf-dir (io/file *home* "standalone/configuration")]
(spit (io/file conf-dir "standalone-isolated-test.xml")
(str/replace
(slurp (io/file conf-dir "standalone.xml"))
#"(?s)<subsystem xmlns=\"urn:jboss:domain:deployment-scanner:1\.1\">.*?</subsystem>"
""))))
(ns demo.client
(:require [enfocus.core :as ef]
[enfocus.events :as events]
[vertx.client.eventbus :as eb])
(:require-macros [enfocus.macros :as em]))
(defn open-eventbus
"Opens a connection to the remote EventBus endpoint."
[& on-open]
(let [eb (eb/eventbus "http://localhost:8081/eventbus")]
var vertx = require('vertx')
var server = vertx.createHttpServer()
vertx.createSockJSServer(server).bridge({prefix: "/eventbus"}, [{}], [{}])
server.listen(8080, function() {server.close()})
(require '[immutant.pipeline :as pl])
(defonce fanout-pl
(pl/pipeline :fanout-example
#(repeat % "hi")
(fn [xs]
(doseq [x xs]
(pl/*pipeline* x :step pl/*next-step*))
pl/halt)
(pl/step println :concurrency 5)))
(defn ^:private add-classpath-to-immediate-cl
([f artifact cl]
(f artifact cl))
([f artifact]
(f artifact (tccl))))
(defmacro ^:private in-dedicated-classloader [project-or-app-root & body]
`(let [old-cl# (tccl)]
(try
(tccl (dedicated-classloader ~project-or-app-root))