aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/msgpack_rpc')
-rw-r--r--src/nvim/msgpack_rpc/channel.c9
-rw-r--r--src/nvim/msgpack_rpc/server.c8
2 files changed, 9 insertions, 8 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index 2a81b4f160..3932fa1f36 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -9,7 +9,7 @@
#include "nvim/api/vim.h"
#include "nvim/msgpack_rpc/channel.h"
#include "nvim/msgpack_rpc/remote_ui.h"
-#include "nvim/os/event.h"
+#include "nvim/event/loop.h"
#include "nvim/os/rstream.h"
#include "nvim/os/rstream_defs.h"
#include "nvim/os/wstream.h"
@@ -220,7 +220,7 @@ Object channel_send_call(uint64_t id,
ChannelCallFrame frame = {request_id, false, false, NIL};
kv_push(ChannelCallFrame *, channel->call_stack, &frame);
channel->pending_requests++;
- event_poll_until(-1, frame.returned);
+ LOOP_POLL_EVENTS_UNTIL(&loop, -1, frame.returned);
(void)kv_pop(channel->call_stack);
channel->pending_requests--;
@@ -474,7 +474,7 @@ static void handle_request(Channel *channel, msgpack_object *request)
event_data->args = args;
event_data->request_id = request_id;
incref(channel);
- event_push((Event) {
+ loop_push_event(&loop, (Event) {
.handler = on_request_event,
.data = event_data
}, defer);
@@ -648,7 +648,8 @@ static void close_channel(Channel *channel)
if (handle) {
uv_close(handle, close_cb);
} else {
- event_push((Event) { .handler = on_stdio_close, .data = channel }, false);
+ loop_push_event(&loop,
+ (Event) { .handler = on_stdio_close, .data = channel }, false);
}
}
diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c
index 388b5a04cf..1a78b3498f 100644
--- a/src/nvim/msgpack_rpc/server.c
+++ b/src/nvim/msgpack_rpc/server.c
@@ -180,14 +180,14 @@ int server_start(const char *endpoint)
if (server_type == kServerTypeTcp) {
// Listen on tcp address/port
- uv_tcp_init(uv_default_loop(), &server->socket.tcp.handle);
+ uv_tcp_init(&loop.uv, &server->socket.tcp.handle);
result = uv_tcp_bind(&server->socket.tcp.handle,
(const struct sockaddr *)&server->socket.tcp.addr,
0);
stream = (uv_stream_t *)&server->socket.tcp.handle;
} else {
// Listen on named pipe or unix socket
- uv_pipe_init(uv_default_loop(), &server->socket.pipe.handle, 0);
+ uv_pipe_init(&loop.uv, &server->socket.pipe.handle, 0);
result = uv_pipe_bind(&server->socket.pipe.handle, server->addr);
stream = (uv_stream_t *)&server->socket.pipe.handle;
}
@@ -308,10 +308,10 @@ static void connection_cb(uv_stream_t *server, int status)
if (srv->type == kServerTypeTcp) {
client = xmalloc(sizeof(uv_tcp_t));
- uv_tcp_init(uv_default_loop(), (uv_tcp_t *)client);
+ uv_tcp_init(&loop.uv, (uv_tcp_t *)client);
} else {
client = xmalloc(sizeof(uv_pipe_t));
- uv_pipe_init(uv_default_loop(), (uv_pipe_t *)client, 0);
+ uv_pipe_init(&loop.uv, (uv_pipe_t *)client, 0);
}
result = uv_accept(server, client);