Class: Ecco::LifecycleFailureListener
- Inherits:
-
Ecco.comcom.githubcom.github.shyikocom.github.shyiko.mysqlcom.github.shyiko.mysql.binlogcom.github.shyiko.mysql.binlog.BinaryLogClientcom.github.shyiko.mysql.binlog.BinaryLogClient::AbstractLifecycleListener
- Object
- Ecco.comcom.githubcom.github.shyikocom.github.shyiko.mysqlcom.github.shyiko.mysql.binlogcom.github.shyiko.mysql.binlog.BinaryLogClientcom.github.shyiko.mysql.binlog.BinaryLogClient::AbstractLifecycleListener
- Ecco::LifecycleFailureListener
- Defined in:
- lib/ecco/lifecycle_failure_listener.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
writeonly
Sets the attribute callback.
Instance Method Summary collapse
-
#initialize ⇒ LifecycleFailureListener
constructor
A new instance of LifecycleFailureListener.
- #onCommunicationFailure(client, exception) ⇒ Object
Constructor Details
#initialize ⇒ LifecycleFailureListener
Returns a new instance of LifecycleFailureListener.
5 6 7 |
# File 'lib/ecco/lifecycle_failure_listener.rb', line 5 def initialize @callback = Proc.new {} end |
Instance Attribute Details
#callback=(value) ⇒ Object (writeonly)
Sets the attribute callback
3 4 5 |
# File 'lib/ecco/lifecycle_failure_listener.rb', line 3 def callback=(value) @callback = value end |
Instance Method Details
#onCommunicationFailure(client, exception) ⇒ Object
9 10 11 12 |
# File 'lib/ecco/lifecycle_failure_listener.rb', line 9 def onCommunicationFailure(client, exception) error = Ecco::Error::CommunicationError.new(exception.) @callback.call(client, error) end |