Class: ZMQ::Socket
- Inherits:
-
Object
- Object
- ZMQ::Socket
- Defined in:
- lib/green/zmq.rb
Instance Method Summary collapse
- #brecvmsg ⇒ Object
- #bsendmsg ⇒ Object
- #close ⇒ Object
-
#initialize(*args) ⇒ Socket
constructor
A new instance of Socket.
- #original_close ⇒ Object
- #recvmsg(message, flags = 0) ⇒ Object
- #sendmsg(message, flags = 0) ⇒ Object
Constructor Details
Instance Method Details
#brecvmsg ⇒ Object
69 |
# File 'lib/green/zmq.rb', line 69 alias :brecvmsg :recvmsg |
#bsendmsg ⇒ Object
54 |
# File 'lib/green/zmq.rb', line 54 alias :bsendmsg :sendmsg |
#close ⇒ Object
85 86 87 88 89 90 |
# File 'lib/green/zmq.rb', line 85 def close @waiter.cancel Green.hub.callback do original_close end end |
#original_close ⇒ Object
84 |
# File 'lib/green/zmq.rb', line 84 alias :original_close :close |
#recvmsg(message, flags = 0) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/green/zmq.rb', line 70 def recvmsg(, flags = 0) return brecvmsg(, flags) if (flags & ZMQ::NonBlocking) != 0 flags |= ZMQ::NonBlocking loop do rc = brecvmsg , flags if rc == -1 && ZMQ::Util.errno == EAGAIN @waiter.lock else @waiter.wake return rc end end end |
#sendmsg(message, flags = 0) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/green/zmq.rb', line 55 def sendmsg(, flags = 0) return bsendmsg(, flags) if (flags & ZMQ::NonBlocking) != 0 flags |= ZMQ::NonBlocking loop do rc = bsendmsg , flags if rc == -1 && ZMQ::Util.errno == EAGAIN @waiter.lock else @waiter.wake return rc end end end |