Name

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

Description

Go::UV::Handle in SPVM represents the base handle for libuv, corresponding to the uv_handle_t structure.

Usage

use Go::UV::Handle;

Fields

close_cb

has close_cb : rw Go::UV::Callback::Close;

The callback called when the handle has been closed.

loop

has loop : ro Go::UV::Loop;

The event loop associated with the handle.

Instance Methods

close_safe

method close_safe : void ($close_cb : Go::UV::Callback::Close = undef);

Request the handle to be closed safely. If the handle is not already closed, it checks whether it is closing using the uv_is_closing function, and if not, calls the uv_close function.

The callback $close_cb is invoked when the handle has been closed.

The callback $close_cb is stored in "close_cb" field.

Exceptions:

If uv_close fails, an exception is thrown.

get_type

method get_type : int ();

Returns the handle type.

This method calls the uv_handle_get_type function.

Well Known Child Classes

Copyright & License

Copyright (c) 2026 Yuki Kimoto

MIT License