Name

SPVM::Go::UV::Handle::Poll - Poll Handle for libuv

Description

Go::UV::Handle::Poll in SPVM represents the poll handle for libuv, corresponding to the uv_poll_t structure.

Super Class

Go::UV::Handle

Usage

use Go::UV::Handle::Poll;

my $poll = Go::UV::Handle::Poll->new;

Fields

poll_cb

has poll_cb : rw Go::UV::Callback::Poll;

The callback called when file descriptor events occur.

Class Methods

new

static method new : Go::UV::Handle::Poll ();

Creates a new Go::UV::Handle::Poll object, and returns it.

Instance Methods

start

method start : void ($cb : Go::UV::Callback::Poll, $events : int);

Starts polling the file descriptor for events specified by $events with the callback $cb.

The callback $cb is stored in "poll_cb" field.

The callback $cb is invoked when the specified events occur.

This method calls the uv_poll_start function.

Exceptions:

If $cb is not defined, an exception is thrown.

If uv_poll_start fails, an exception is thrown.

Copyright & License

Copyright (c) 2026 Yuki Kimoto

MIT License