Class: Mongo::Protocol::KillCursors
| Relationships & Source Files | |
| Namespace Children | |
|
Classes:
| |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Message
|
|
|
Instance Chain:
|
|
| Inherits: |
Mongo::Protocol::Message
|
| Defined in: | lib/mongo/protocol/kill_cursors.rb |
Overview
MongoDB Wire protocol KillCursors message.
This is a client request message that is sent to the server in order to kill a number of cursors.
Constant Summary
-
OP_CODE =
# File 'lib/mongo/protocol/kill_cursors.rb', line 72
The operation code required to specify
KillCursorsmessage.2007
Serializers - Included
HEADER_PACK, INT32_PACK, INT64_PACK, NULL, ZERO
Message - Inherited
Class Method Summary
-
.new(collection, database, cursor_ids) ⇒ KillCursors
constructor
Creates a new
KillCursorsmessage.
Message - Inherited
| .deserialize | Deserializes messages from an IO stream. |
| .new | :nodoc: |
| .deserialize_array | Deserializes an array of fields in a message. |
| .deserialize_field | Deserializes a single field in a message. |
| .deserialize_header | Deserializes the header of the message. |
| .field | A method for declaring a message field. |
| .fields | A class method for getting the fields for a message class. |
Instance Attribute Summary
- #cursor_ids ⇒ Array<Fixnum> rw private
- #id_count ⇒ Fixnum rw private
Message - Inherited
| #replyable? | The default for messages is not to require a reply after sending a message to the server. |
| #request_id | Returns the request id for the message. |
Instance Method Summary
-
#payload ⇒ BSON::Document
Return the event payload for monitoring.
Message - Inherited
| #== | Tests for equality between two wire protocol messages by comparing class and field values. |
| #eql? | Alias for Message#==. |
| #hash | Creates a hash from the values of the fields of a message. |
| #maybe_add_server_api, | |
| #maybe_compress | Compress the message, if supported by the wire protocol used and if the command being sent permits compression. |
| #maybe_decrypt | Possibly decrypt this message with libmongocrypt. |
| #maybe_encrypt | Possibly encrypt this message with libmongocrypt. |
| #maybe_inflate | Inflate a message if it is compressed. |
| #number_returned | Default number returned value for protocol messages. |
| #serialize | Serializes message into bytes that can be sent on the wire. |
| #set_request_id | Generates a request id for a message. |
| #to_s | Alias for Message#serialize. |
| #compress_if_possible | Compress the message, if the command being sent permits compression. |
| #fields | A method for getting the fields for a message class. |
| #merge_sections, | |
| #serialize_fields | Serializes message fields into a buffer. |
| #serialize_header | Serializes the header of the message consisting of 4 32bit integers. |
Constructor Details
.new(collection, database, cursor_ids) ⇒ KillCursors
Creates a new KillCursors message
# File 'lib/mongo/protocol/kill_cursors.rb', line 37
def initialize(collection, database, cursor_ids) @database = database @cursor_ids = cursor_ids @id_count = @cursor_ids.size @upconverter = Upconverter.new(collection, cursor_ids) super end
Instance Attribute Details
#cursor_ids ⇒ Array<Fixnum> (rw, private)
# File 'lib/mongo/protocol/kill_cursors.rb', line 83
field :cursor_ids, Int64, true
#id_count ⇒ Fixnum (rw, private)
# File 'lib/mongo/protocol/kill_cursors.rb', line 79
field :id_count, Int32
Instance Method Details
#payload ⇒ BSON::Document
Return the event payload for monitoring.
# File 'lib/mongo/protocol/kill_cursors.rb', line 53
def payload BSON::Document.new( command_name: 'killCursors', database_name: @database, command: upconverter.command, request_id: request_id, ) end