Skip to content
Browse files

1.3 metadata changes

  • Loading branch information...
1 parent 32da020 commit fcdb7d3a32b4a17d722cb3e33d5fc8d56fa4a1f4 @senior senior committed
30 src/com/twinql/clojure/async_client.clj
@@ -56,7 +56,7 @@
(:require [com.twinql.clojure.async-libs :as async]))
-(def #^AllowAllHostnameVerifier allow-all-hostname-verifier
+(def ^AllowAllHostnameVerifier allow-all-hostname-verifier
@@ -96,26 +96,26 @@
(defrecord InternalExceptionHandler
- (#^boolean handle [this #^IOException ex] (fn ex))
- (#^boolean handle [this #^RuntimeException ex] (fn ex)))
+ (^boolean handle [this ^IOException ex] (fn ex))
+ (^boolean handle [this ^RuntimeException ex] (fn ex)))
(defrecord KeepAliveStrategy
- [#^long milliseconds]
+ [^long milliseconds]
(getKeepAliveDuration [this response context] milliseconds))
-(defn #^CountDownLatch countdown-latch
+(defn ^CountDownLatch countdown-latch
"Returns a CountdownLatch for managing async IO. Param num-requests must
specify the number of http requests that the callback will be handling."
(CountDownLatch. num-requests))
-(defn #^DefaultConnectingIOReactor io-reactor
+(defn ^DefaultConnectingIOReactor io-reactor
"Returns a new instance of
- [#^Integer worker-count
- #^IOReactorExceptionHandler internal-exception-handler
- #^org.apache.http.params.HttpParams params]
+ [^Integer worker-count
+ ^IOReactorExceptionHandler internal-exception-handler
+ ^org.apache.http.params.HttpParams params]
(let [reactor (DefaultConnectingIOReactor. worker-count params)]
(if (not (nil? internal-exception-handler))
(. reactor setExceptionHandler
@@ -151,7 +151,7 @@
-(defn #^SyncBasicHttpParams create-http-params
+(defn ^SyncBasicHttpParams create-http-params
"Returns an HttpParams object with the specified settings. To make your life
easier, use com.twinql.clojure.http/map->params to construct a map with
friendly param names. For example:
@@ -173,11 +173,11 @@
-(defn #^PoolingClientConnectionManager pooling-conn-manager
+(defn ^PoolingClientConnectionManager pooling-conn-manager
"Returns a PoolingClientConnectionManager"
- [#^org.apache.http.nio.reactor.ConnectingIOReactor ioreactor
- #^org.apache.http.nio.conn.scheme.SchemeRegistry registry
- #^long time-to-live]
+ [^org.apache.http.nio.reactor.ConnectingIOReactor ioreactor
+ ^org.apache.http.nio.conn.scheme.SchemeRegistry registry
+ ^long time-to-live]
(PoolingClientConnectionManager. ioreactor
@@ -192,7 +192,7 @@
-(defn #^PoolingClientConnectionManager connection-manager
+(defn ^PoolingClientConnectionManager connection-manager
"Returns a PoolingClientConnectionManager with the specified options.
Param options is a hash-map that may include the following. Any unset
vars will default to the value in *default-opts*.
23 src/com/twinql/clojure/async_libs.clj
@@ -28,24 +28,25 @@
- SchemeRegistry)))
+ SchemeRegistry
+ LayeringStrategy)))
-(defn #^SSLLayeringStrategy layering-strategy
+(defn ^SSLLayeringStrategy layering-strategy
"Returns a new LayeringStrategy for managing SSL connections."
- [#^SSLContext ssl-context #^X509HostnameVerifier hostname-verifier]
+ [^SSLContext ssl-context ^X509HostnameVerifier hostname-verifier]
(let [verifier (or hostname-verifier (AllowAllHostnameVerifier.))]
(SSLLayeringStrategy. ssl-context verifier)))
-(defn #^Scheme scheme
+(defn ^Scheme scheme
"Returns a new org.apache.http.nio.conn.scheme.Scheme. Param name should
be \"http\" or \"https\". Param port is the port to connect to on the
remote host."
- [#^String name #^long port #^LayeringStrategy strategy]
+ [^String name ^long port ^LayeringStrategy strategy]
(Scheme. name port strategy))
-(defn #^Scheme default-http-scheme []
+(defn ^Scheme default-http-scheme []
(Scheme. "http" 80 nil))
(defn #^Scheme default-https-scheme []
@@ -53,18 +54,18 @@
(.init ctx nil nil nil)
(Scheme. "https" 443 (SSLLayeringStrategy. ctx))))
-(defn #^SchemeRegistry default-scheme-registry []
+(defn ^SchemeRegistry default-scheme-registry []
(doto (SchemeRegistry.)
(. register (default-http-scheme))
(. register (default-https-scheme))))
-(defn #^org.apache.http.nio.conn.scheme.SchemeRegistry scheme-registry
+(defn ^org.apache.http.nio.conn.scheme.SchemeRegistry scheme-registry
"Creates a scheme registry using the given socket factory to connect
on the port you specify. This scheme registry is suitable for the async
http client."
- [#^SSLSocketFactory socket-factory #^Long port
- #^SSLLayeringStrategy ssl-layering-strategy]
- (let [#^SchemeRegistry scheme-registry (SchemeRegistry.)]
+ [^SSLSocketFactory socket-factory ^Long port
+ ^SSLLayeringStrategy ssl-layering-strategy]
+ (let [^SchemeRegistry scheme-registry (SchemeRegistry.)]
(.register scheme-registry (Scheme. "https" port ssl-layering-strategy))

0 comments on commit fcdb7d3

Please sign in to comment.
Something went wrong with that request. Please try again.