Wraps a +Session::RPC+ in a synchronous API using +Fiber+s.
@api private
Connect to the current process‘s standard streams. This is used to promote the current process to a Ruby plugin host.
Discover the nvim API as described in the vim_get_api_info call, propagating it down to lower layers of the stack.
Make an RPC request and return its response.
If this method is called inside a callback, we are already inside a Fiber handler. In that case, we write to the stream and yield the Fiber. Once the response is received, resume the Fiber and return the result.
If this method is called outside a callback, write to the stream and run the event loop until a response is received. Messages received in the meantime are enqueued to be handled later.