class SysVIPC::MessageQueue
Attributes
msgid[R]
Public Class Methods
new(key, flags = 0)
click to toggle source
Return a MessageQueue
object encapsuating a message queue associated with key
. See msgget(2).
# File lib/SysVIPC.rb 113 def initialize(key, flags = 0) 114 @msgid = msgget(key, flags) 115 check_result(@msgid) 116 end
Public Instance Methods
ipc_rmid()
click to toggle source
Remove. See msgctl(2).
# File lib/SysVIPC.rb 144 def ipc_rmid 145 check_result(msgctl(@msgid, IPC_RMID, nil)) 146 end
Also aliased as: rm
ipc_set(msqid_ds)
click to toggle source
Set the Msqid_ds
object. See msgctl(2).
# File lib/SysVIPC.rb 133 def ipc_set(msqid_ds) 134 unless Msqid_ds === msqid_ds 135 raise ArgumentError, 136 "argument to ipc_set must be a Msqid_ds" 137 end 138 check_result(msgctl(@msgid, IPC_SET, msqid_ds)) 139 end
Also aliased as: msqid_ds=
ipc_stat()
click to toggle source
Return the Msqid_ds
object. See msgctl(2).
# File lib/SysVIPC.rb 124 def ipc_stat 125 res, msqid_ds = msgctl(@msgid, IPC_STAT) 126 check_result(res) 127 msqid_ds 128 end
Also aliased as: msqid_ds
rcv(type, size, flags = 0)
click to toggle source
Receive a message of type type
, limited to len
bytes or fewer. See msgrcv(2).
# File lib/SysVIPC.rb 159 def rcv(type, size, flags = 0) 160 res, mtype, mtext = msgrcv(@msgid, size, type, flags) 161 check_result(res) 162 mtext 163 end
Also aliased as: receive
snd(type, text, flags = 0)
click to toggle source
Send a message with type type
and text text
. See msgsnd(2).
# File lib/SysVIPC.rb 151 def snd(type, text, flags = 0) 152 check_result(msgsnd(@msgid, type, text, flags)) 153 end
Also aliased as: send