Name

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

Description

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

Super Class

UV::Handle

Usage

use UV::Handle::Poll;

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

Fields

poll_cb

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

The callback called when file descriptor events occur.

Class Methods

new

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

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

Instance Methods

start

method start : void ($cb : 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