Class: Neo4j::Core::CypherSession::Adaptors::Bolt::Job
- Inherits:
-
Object
- Object
- Neo4j::Core::CypherSession::Adaptors::Bolt::Job
- Defined in:
- lib/neo4j/core/cypher_session/adaptors/bolt.rb
Overview
Represents a set of messages to send to the server
Instance Method Summary collapse
- #add_message(type, *args) ⇒ Object
- #chunked_packed_stream ⇒ Object
-
#initialize(session) ⇒ Job
constructor
A new instance of Job.
- #to_s ⇒ Object
Constructor Details
#initialize(session) ⇒ Job
Returns a new instance of Job.
316 317 318 319 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 316 def initialize(session) @messages = [] @session = session end |
Instance Method Details
#add_message(type, *args) ⇒ Object
321 322 323 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 321 def (type, *args) @messages << Message.new(type, *args) end |
#chunked_packed_stream ⇒ Object
325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 325 def chunked_packed_stream io = ChunkWriterIO.new @messages.each do || io.write(.packed_stream) io.flush(true) end io.rewind io.read end |
#to_s ⇒ Object
337 338 339 |
# File 'lib/neo4j/core/cypher_session/adaptors/bolt.rb', line 337 def to_s @messages.join(' | ') end |