Name

SPVM::IO::Pipe - Non-blocking Pipes with Goroutines

Description

SPVM::IO::Pipe provides a factory for creating a pair of connected, non-blocking pipe ends. It is designed to work seamlessly with SPVM::Go for asynchronous inter-process or inter-goroutine communication.

Usage

use IO::Pipe;
use Go;

# Create a non-blocking pipe pair
my $pipe = IO::Pipe->new;
my $handles = $pipe->handles;

my $reader = $handles->[0];
my $writer = $handles->[1];

Fields

handles

has handles : ro IO::Pipe::End[];

An array containing two IO::Pipe::End instances representing both ends of the pipe.

Instance Methods

new

static method new : IO::Pipe ();

Creates a new non-blocking pipe pair and returns an IO::Pipe instance containing the two pipe ends.

On Unix-like systems, this method creates a pair of connected non-blocking streams using socketpair. On Windows, it creates a pair of non-blocking connected pipes (such as named pipes).

See Also

Copyright & License

Copyright (c) 2026 Yuki Kimoto

MIT License