W3cubDocs

/Pony

_Pipe

[Source]

A pipe is a unidirectional data channel that can be used for interprocess communication. Outgoing pipes are written to by this process, incoming pipes are read from by this process.

class ref _Pipe

Constructors

none

[Source]

Creates a nil pipe for use as a placeholder.

new ref none()
: _Pipe ref^

Returns

outgoing

[Source]

Creates an outgoing pipe.

new ref outgoing()
: _Pipe ref^ ?

Returns

incoming

[Source]

Creates an incoming pipe.

new ref incoming()
: _Pipe ref^ ?

Returns

Public fields

var near_fd: U32 val

[Source]

var far_fd: U32 val

[Source]

var event: Pointer[AsioEvent val] tag

[Source]

Public Functions

begin

[Source]

Prepare the pipe for read or write, and listening, after the far end has been handed to the other process.

fun ref begin(
  owner: AsioEventNotify tag)
: None val

Parameters

Returns

close_far

[Source]

Close the far end of the pipe--the end that the other process will be using. This is used to cleanup this process' handles that it wont use.

fun ref close_far()
: None val

Returns

read

[Source]

fun ref read(
  read_buf: Array[U8 val] iso,
  offset: USize val)
: (Array[U8 val] iso^ , ISize val , I32 val)

Parameters

Returns

write

[Source]

fun ref write(
  data: (String box | Array[U8 val] box),
  offset: USize val)
: (ISize val , I32 val)

Parameters

Returns

is_closed

[Source]

fun ref is_closed()
: Bool val

Returns

close_near

[Source]

Close the near end of the pipe--the end that this process is using directly. Also handle unsubscribing the asio event (if there was one). File descriptors should always be closed after unsubscribing its event, otherwise there is the possibility of reusing the file descriptor in another thread and then unsubscribing the reused file descriptor here! Unsubscribing and closing the file descriptor should be treated as one operation.

fun ref close_near()
: None val

Returns

close

[Source]

fun ref close()
: None val

Returns

dispose

[Source]

fun ref dispose()
: None val

Returns

Private Functions

_create

[Source]

Do the actual system object creation for the pipe.

fun ref _create()
: None val ?

Returns

_set_fd

[Source]

fun box _set_fd(
  fd: U32 val,
  flags: I32 val)
: None val ?

Parameters

Returns

_set_fl

[Source]

fun box _set_fl(
  fd: U32 val,
  flags: I32 val)
: None val ?

Parameters

Returns

© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/process-_Pipe