net.ty.future

Handy functions to deal with netty futures

add-close-listener

(add-close-listener chan)

Add close-listener to a channel

add-listener

(add-listener chan listener)

Add a listener to a channel

await!

(await! future)

cancelled?

(cancelled? f)

Predicate to test for future cancellation

close-listener

Listener which closes a channel

complete?

(complete? f)

Predicate to test for future completeness

deflistener

macro

(deflistener sym [listener ftr bindings] & body)

Define a channel future listener

incomplete?

(incomplete? f)

Predicate to test for future cancellation or failure

listen-with

(listen-with f)

operation-complete

(operation-complete listener)(operation-complete listener future)

Signal that operation completed on a listener

success?

(success? f)

Predicate to test for future success

sync!

(sync! future)

Synchronize future

with-result

macro

(with-result [ftr action] & body)

Marco to create future listeners