Class: MySQLNoIo::Wraps::DeactivatedSlave
- Inherits:
-
Object
- Object
- MySQLNoIo::Wraps::DeactivatedSlave
- Defined in:
- lib/mysqlnoio/wraps/deactivated_slave.rb
Overview
Stops the database slave entirely for your command
Instance Method Summary collapse
- #execute(&block) ⇒ Object
-
#initialize(mysql) ⇒ DeactivatedSlave
constructor
A new instance of DeactivatedSlave.
Constructor Details
#initialize(mysql) ⇒ DeactivatedSlave
Returns a new instance of DeactivatedSlave.
5 6 7 |
# File 'lib/mysqlnoio/wraps/deactivated_slave.rb', line 5 def initialize mysql @mysql = mysql end |
Instance Method Details
#execute(&block) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/mysqlnoio/wraps/deactivated_slave.rb', line 9 def execute &block @mysql.query('STOP SLAVE;') yield ensure @mysql.query('START SLAVE;') end |