Class: Neovim::RemoteModule
- Includes:
- Logging
- Defined in:
- lib/neovim/remote_module.rb,
lib/neovim/remote_module/dsl.rb
Defined Under Namespace
Classes: DSL
Constant Summary
Constants included from Logging
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(handlers) ⇒ RemoteModule
constructor
A new instance of RemoteModule.
- #start ⇒ Object
Methods included from Logging
Constructor Details
#initialize(handlers) ⇒ RemoteModule
Returns a new instance of RemoteModule.
15 16 17 |
# File 'lib/neovim/remote_module.rb', line 15 def initialize(handlers) @handlers = handlers end |
Class Method Details
Instance Method Details
#start ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/neovim/remote_module.rb', line 19 def start event_loop = EventLoop.stdio session = Session.new(event_loop) client = nil session.run do || case when Message::Request begin client ||= Client.from_event_loop(event_loop, session) args = .arguments.flatten(1) @handlers[.method_name].call(client, *args).tap do |rv| session.respond(.id, rv, nil) if .sync? end rescue => e log_exception(:error, e, __method__) session.respond(.id, nil, e.) if .sync? end end end end |