Class: Aggro::ZeroMQTransport::Server::Workload

Inherits:
Struct
  • Object
show all
Defined in:
lib/aggro/zeromq_transport/server.rb

Overview

Private: Struct to hold request workload data.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#identityObject

Returns the value of attribute identity

Returns:

  • (Object)

    the current value of identity



8
9
10
# File 'lib/aggro/zeromq_transport/server.rb', line 8

def identity
  @identity
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



8
9
10
# File 'lib/aggro/zeromq_transport/server.rb', line 8

def message
  @message
end

#mutexObject

Returns the value of attribute mutex

Returns:

  • (Object)

    the current value of mutex



8
9
10
# File 'lib/aggro/zeromq_transport/server.rb', line 8

def mutex
  @mutex
end

#socketObject

Returns the value of attribute socket

Returns:

  • (Object)

    the current value of socket



8
9
10
# File 'lib/aggro/zeromq_transport/server.rb', line 8

def socket
  @socket
end

Instance Method Details

#finish(reply) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/aggro/zeromq_transport/server.rb', line 9

def finish(reply)
  mutex.synchronize do
    socket.send_string identity, ZMQ::SNDMORE
    socket.send_string '', ZMQ::SNDMORE
    socket.send_string reply.to_s
  end
end