system.pipe - Palamecia/mint GitHub Wiki

Module system.pipe

Description

load system.pipe

This module provides the System.Pipe class which provides a one-way awaitable communication mechanism.

Packages

Classes

System.Pipe

This class provides an awaitable pipe communication mechanism that trigger an event when data become available on the read part.

This type is not copyable

Public members

Modifiers Member Description
const delete Cleans up the pipe instance.
const getHandle Returns the handle used by System.Pipe.System.Poller.
const getReadHandle Returns a handle useable by System.Pipe.System.Poller to wait for data on the...
const getWriteHandle Returns a handle useable by System.Pipe.System.Poller to wait for data on the...
const new Creates a new pipe. The created pipe is empty. If no pipe can be created, none...
const read Returns the data contained in the read end of the pipe. The pipe's data is co...
const readSome Returns at most count bytes of data contained in the read end of the pipe. Th...
const reset Reset the internal event state
const wait Waits until data is available on the read end of the pipe. If timeout is give...
const write Writes the data on the write end of the pipe.

Private members

Modifiers Member Description
const clone Disable object copy.
final eventHandleRead Internal read handle.
final eventHandleWrite Internal write handle.
@ const g_lib Global library handle.

Descriptions

System.Pipe.clone

none

Disable object copy.

System.Pipe.delete

def (self)

Cleans up the pipe instance.

System.Pipe.eventHandleRead

none

Internal read handle.

System.Pipe.eventHandleWrite

none

Internal write handle.

System.Pipe.g_lib

lib ('libmint-system')

Global library handle.

System.Pipe.getHandle

def (const self)

Returns the handle used by System.Poller.

System.Pipe.getReadHandle

def (const self)

Returns a handle useable by System.Poller to wait for data on the read end of the pipe.

System.Pipe.getWriteHandle

def (const self)

Returns a handle useable by System.Poller to wait for data on the write end of the pipe.

System.Pipe.new

def (self)

Creates a new pipe. The created pipe is empty.

If no pipe can be created, none is returned.

System.Pipe.read

def (self)

Returns the data contained in the read end of the pipe.

The pipe's data is contained in an instance of Serializer.DataStream.

System.Pipe.readSome

def (self, count)

Returns at most count bytes of data contained in the read end of the pipe.

The pipe's data is contained in an instance of Serializer.DataStream.

System.Pipe.reset

def (self)

Reset the internal event state

System.Pipe.wait

def (self, timeout = none)

Waits until data is available on the read end of the pipe. If timeout is given, the wait stop after timeout milliseconds if the pipe still have no data to read.

Returns true if data is available on the read end of the pipe; otherwise returns false if the wait timed out.

After a call to this method, the event is reset.

System.Pipe.write

def (self, data)

Writes the data on the write end of the pipe.