Permalink
Browse files

- moved creation of timer to connect function to prevent continuously…

… creation of timers
  • Loading branch information...
1 parent 987cfd9 commit 4990d30a28092752ca13f804b52e76c051fa06eb @niclasmeier niclasmeier committed Jul 4, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 project.clj
  2. +4 −4 src/herolabs/apns/push.clj
View
@@ -1,4 +1,4 @@
-(defproject herolabs/apns "0.1.7"
+(defproject herolabs/apns "0.1.8"
:description "A simple lightweight library to use with the Apple push notification service."
:url "https://github.com/HEROLABS/herolabs-apns"
:dependencies [[org.clojure/clojure "1.4.0"]
@@ -75,13 +75,12 @@
(defn- create-ssl-handler-factory [ssl-engine-factory] (fn [] (SslHandler. (ssl-engine-factory))))
-(defn- create-pipeline-factory [ssl-handler-factory protocoll-handler time-out]
+(defn- create-pipeline-factory [ssl-handler-factory protocoll-handler timer time-out]
"Creates a pipeline factory"
(reify
ChannelPipelineFactory
(getPipeline [this]
- (let [id-gen (AtomicInteger.)
- timer (HashedWheelTimer.)]
+ (let [id-gen (AtomicInteger.)]
(doto (Channels/pipeline)
(.addLast "ssl" (ssl-handler-factory))
(.addLast "encoder" (encoder id-gen))
@@ -103,8 +102,9 @@
boss-executor worker-executor) (ClientBootstrap.))
ssl-handler-factory (create-ssl-handler-factory engine-factory)
client-handle (atom nil)
+ timer (HashedWheelTimer.)
pipeline-factory (create-pipeline-factory ssl-handler-factory (handler bootstrap ssl-handler-factory client-handle
- exception-handler) time-out)
+ exception-handler) timer time-out)
bootstrap (doto bootstrap
(.setOption "connectTimeoutMillis" 5000)
(.setPipelineFactory pipeline-factory)

0 comments on commit 4990d30

Please sign in to comment.