Class: Ecco::SaveEventListener
Constant Summary
collapse
- SAVE_EVENTS =
[
EventType::QUERY,
EventType::ROTATE,
EventType::WRITE_ROWS,
EventType::UPDATE_ROWS,
EventType::DELETE_ROWS,
]
Instance Attribute Summary
#callback
Instance Method Summary
collapse
#initialize
Instance Method Details
#accepted_events ⇒ Object
13
14
15
|
# File 'lib/ecco/save_event_listener.rb', line 13
def accepted_events
SAVE_EVENTS
end
|
#on_event(event) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/ecco/save_event_listener.rb', line 17
def on_event(event)
type = event..get_event_type
case type
when *accepted_events
filename = @client.get_binlog_filename
position = @client.get_binlog_position
@callback.call(filename, position)
end
end
|