Class: Alo7::Net::Defer

Inherits:
Object
  • Object
show all
Includes:
EM::Deferrable
Defined in:
lib/alo7/net/defer.rb

Overview

This is a callback which will be put off until later.

Instance Method Summary collapse

Instance Method Details

#callback(&block) ⇒ self

Specify a block to be executed if and when the Deferrable object succeeded.

  • If there is no status, add a callback to an internal list.

  • If status is succeeded, execute the callback immediately.

  • If status is failed, do nothing.


# File 'lib/alo7/net/defer.rb', line 9

#cancel_callbackMethodObject

Cancels an outstanding callback to &block if any. Undoes the action of #callback.


# File 'lib/alo7/net/defer.rb', line 19

#cancel_errbackMethodObject

Cancels an outstanding errback to &block if any. Undoes the action of #errback.


# File 'lib/alo7/net/defer.rb', line 34

#errbackself

Specify a block to be executed if and when the Deferrable object failed.

  • If there is no status, add a errback to an internal list.

  • If status is failed, execute the errback immediately.

  • If status is succeeded, do nothing.


# File 'lib/alo7/net/defer.rb', line 24

#fail(*args) ⇒ void

This method returns an undefined value.

Execute all of the blocks passed to the object using the #errback method (if any) BEFORE this method returns. All of the blocks passed to the object using #callback will be discarded.


# File 'lib/alo7/net/defer.rb', line 47

#succeed(*args) ⇒ void

This method returns an undefined value.

Execute all of the blocks passed to the object using the #callback method (if any) BEFORE this method returns. All of the blocks passed to the object using #errback will be discarded.


# File 'lib/alo7/net/defer.rb', line 39