Skip to content

Instantly share code, notes, and snippets.

@SeanTAllen
Created August 16, 2014 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanTAllen/c61d1b1431169cefaad7 to your computer and use it in GitHub Desktop.
Save SeanTAllen/c61d1b1431169cefaad7 to your computer and use it in GitHub Desktop.
What exactly is going on here?
(defn mk-executor-transfer-fn [batch-transfer->worker]
(fn this
([task tuple block? ^List overflow-buffer]
(if (and overflow-buffer (not (.isEmpty overflow-buffer)))
(.add overflow-buffer [task tuple])
(try-cause
(disruptor/publish batch-transfer->worker [task tuple] block?)
(catch InsufficientCapacityException e
(if overflow-buffer
(.add overflow-buffer [task tuple])
(throw e))
))))
([task tuple overflow-buffer]
(this task tuple (nil? overflow-buffer) overflow-buffer))
([task tuple]
(this task tuple nil)
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment