Module: Kernel

Defined in:
lib/xchan.rb

Instance Method Summary collapse

Instance Method Details

#xchan(s) ⇒ 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>)

    The name of a serializer

  • sock (Integer)

    Type of socket (eg Socket::SOCK_STREAM)

  • tmpdir (String)

    Directory where temporary files can be stored

  • lock (Symbol, <Lock::File, Chan::NullLock>)

    The name of a lock, or an instance of Lock::File, or Chan::NullLock

Returns:



85
86
87
# File 'lib/xchan.rb', line 85

def xchan(s, ...)
  Chan::UNIXSocket.new(s, ...)
end