Module: Chan::Mixin

Included in:
Object
Defined in:
lib/xchan/mixin.rb

Overview

A module that is included into Ruby's Object class.

Instance Method Summary collapse

Instance Method Details

#xchan(serializer = :marshal, **kw_args) ⇒ Chan::UNIXSocket

Returns an instance of Chan::UNIXSocket.

Examples:

ch = xchan
ch.send([1,2,3])
ch.recv.pop # => 3
ch.close

Parameters:

  • serializer (Symbol, <#dump, #load>) (defaults to: :marshal)

    A serializer.

  • sock_type (Integer)

    A socket type (eg Socket::SOCK_STREAM).

  • tmpdir (String)

    Path to a directory where temporary files will be stored.

Returns:



17
18
19
# File 'lib/xchan/mixin.rb', line 17

def xchan(serializer = :marshal, **kw_args)
  Chan::UNIXSocket.new(serializer, **kw_args)
end