diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2021-06-14 16:21:08 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-14 16:21:08 +1200 |
commit | 2792acc8f29c6ee1d04b57b7b70d43519a0ceda8 (patch) | |
tree | f34d853b85cac91a51cb2500c9c4b765433e3672 /scheduler.c | |
parent | 688b217706546c2bc9a0926de246dc29d0935261 (diff) |
Add scheduler hook `Addrinfo.getaddrinfo`. (#4375)
Co-authored-by: Bruno Sutic <code@brunosutic.com>
Notes
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'scheduler.c')
-rw-r--r-- | scheduler.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scheduler.c b/scheduler.c index 38846b6611..5937d61007 100644 --- a/scheduler.c +++ b/scheduler.c @@ -25,6 +25,8 @@ static ID id_io_read; static ID id_io_write; static ID id_io_wait; +static ID id_address_resolve; + void Init_Fiber_Scheduler(void) { @@ -40,6 +42,8 @@ Init_Fiber_Scheduler(void) id_io_read = rb_intern_const("io_read"); id_io_write = rb_intern_const("io_write"); id_io_wait = rb_intern_const("io_wait"); + + id_address_resolve = rb_intern_const("address_resolve"); } VALUE @@ -200,3 +204,13 @@ rb_fiber_scheduler_io_write(VALUE scheduler, VALUE io, VALUE buffer, size_t offs // We should ensure string has capacity to receive data, and then resize it afterwards. return rb_check_funcall(scheduler, id_io_write, 4, arguments); } + +VALUE +rb_fiber_scheduler_address_resolve(VALUE scheduler, VALUE hostname) +{ + VALUE arguments[] = { + hostname + }; + + return rb_check_funcall(scheduler, id_address_resolve, 1, arguments); +} |