Name

SPVM::UV::Handle::Signal - Signal Handle for libuv

Description

UV::Handle::Signal in SPVM represents the signal handle for libuv, corresponding to the uv_signal_t structure.

Super Class

UV::Handle

Usage

use UV::Handle::Signal;

my $signal = UV::Handle::Signal->new;

Fields

signal_cb

has signal_cb : rw UV::Callback::Signal;

The callback called when the signal is received.

Class Methods

new

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

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

Instance Methods

start

method start : void ($cb : UV::Callback::Signal, $signum : int);

Starts the signal handle with the callback $cb and the signal number $signum.

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

The callback $cb is invoked when the signal $signum is received.

This method calls the uv_signal_start function.

Exceptions:

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

If uv_signal_start fails, an exception is thrown.

stop

method stop : void ();

Stops the signal handle.

This method calls the uv_signal_stop function.

Exceptions:

If uv_signal_stop fails, an exception is thrown.

Repository

https://github.com/kimoto/SPVM-UV

Author

Yuki Kimoto kimoto.yuki@gmail.com

Copyright & License

Copyright (c) 2026 Yuki Kimoto

MIT License