{"id":21707763,"url":"https://github.com/flightaware/tclrmq","last_synced_at":"2026-02-25T14:39:50.785Z","repository":{"id":47644971,"uuid":"107352035","full_name":"flightaware/tclrmq","owner":"flightaware","description":"Pure Tcl Library for RabbitMQ","archived":false,"fork":false,"pushed_at":"2021-08-19T21:07:29.000Z","size":154,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-08T21:39:22.444Z","etag":null,"topics":["amqp0-9-1","asynchronous","asyncio","event-loop","rabbitmq","rabbitmq-client","tcl"],"latest_commit_sha":null,"homepage":null,"language":"Tcl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flightaware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-18T03:02:16.000Z","updated_at":"2023-11-26T14:31:56.000Z","dependencies_parsed_at":"2022-09-23T15:01:43.984Z","dependency_job_id":null,"html_url":"https://github.com/flightaware/tclrmq","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/flightaware/tclrmq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flightaware%2Ftclrmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flightaware%2Ftclrmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flightaware%2Ftclrmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flightaware%2Ftclrmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flightaware","download_url":"https://codeload.github.com/flightaware/tclrmq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flightaware%2Ftclrmq/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268327737,"owners_count":24232732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqp0-9-1","asynchronous","asyncio","event-loop","rabbitmq","rabbitmq-client","tcl"],"created_at":"2024-11-25T22:19:10.873Z","updated_at":"2025-10-25T22:09:06.299Z","avatar_url":"https://github.com/flightaware.png","language":"Tcl","readme":"# tclrmq\nPure TCL RabbitMQ Library implementing AMQP 0.9.1\n\nThis library is completely asynchronous and makes no blocking calls.\nIt relies on TclOO and requires Tcl 8.6, but has no other dependencies \n(other than a RabbitMQ server).\n\n# About\nDeveloped for use within FlightAware (https://flightaware.com).\n\nThe package directory contains a Makefile for installing globally.  By\ndefault the Makefile installs to `/usr/local/lib`, so this will need editing\nif an alternative directory is required.\n\n# Basic Usage\nThere are two primary classes required for using the library.\n\n1) Connection\n\nThe _Connection_ class is used for initiating initial communication with the\nRabbitMQ server.  It also relies on a subsidiary _Login_ class, which is used\nfor specifying username, password, vhost and authentication mechanism.  Out of\nthe box, this library only supports the PLAIN SASL mechanism.  It can be easily\nextended to support an additional mechanism if required.\n\n```tcl\npackage require rmq\n\n# Arguments: -user -pass -vhost\n# All optional and shown with their defaults\nset login [Login new -user \"guest\" -pass \"guest\" -vhost \"/\"]\n\n# Pass the login object created above to the Connection\n# constructor\n# -host and -port are shown with their default values\nset conn [Connection new -host localhost -port 5672 -login $login]\n\n# Set a callback for when the connection is ready to use\n# which will be passed the connection object \n$conn onConnected rmq_conn_ready\nproc rmq_conn_ready {conn} {\n    puts \"Connection ready!\"\n    $conn connectionClose\n}\n\n# Set a callback for when the connection is closed\n$conn onClosed rmq_conn_closed\nproc rmq_conn_closed {conn} {\n    puts \"Connection closed!\"\n}\n\n# Initiate the connection handshake and enter the event loop\n$conn connect\nvwait die\n```\n\n2) Channel\n\nThe _Channel_ class is where most of the action happens.  The vast majority of AMQP\nmethods refer to a specific channel.  After the Connection object has gone through\nthe opening handshake and calls its _onOpen_ callback, a _Channel_ object can be\ncreated by passing the _Connection_ object to the _Channel_ class' constructor.\n\n```tcl\n# Assume the following proc has been set as the Connection object's \n# onOpen callback\nproc rmq_conn_ready {conn} {\n    # Create a channel object\n    # If no channel number is specified, the\n    # next available will be chosen\n    set chan [Channel new $conn]\n\n    # Do something with the channel, like \n    # declare an exchange\n    set flags [list $::rmq::EXCHANGE_DURABLE]\n    $chan exchangeDeclare \"test\" \"direct\" $flags\n}\n```\n\n# Callbacks\nUsing this library for anything useful requires setting callbacks for the\nAMQP methods needed in the client application. Most callbacks will be set on\n_Channel_ objects, but the _Connection_ object supports a few as well.\n\nAll callbacks are passed the object they were set on as the first parameter.\nDepending on the AMQP method or object event, additional parameters are provided\nas appropriate.\n\n## Connection Callbacks\n\nConnection objects allow for the setting of the following callbacks:\n\n1) _onConnected_: called when the AMQP connection handshake finishes and is passed the\n                  _Connection_ object\n\n2) _onBlocked_: called when the RabbitMQ server has blocked connections due to\n                [resource limitations](https://www.rabbitmq.com/connection-blocked.html).\n                Callback is passed the _Connection_ object, a boolean for whether the connection\n                is blocked or not and a textual reason\n\n3) _onClosed_: called when the connection is closed and is passed the _Connection_ object\n               and a dict containing the reply code, any reply text, the class ID and the method ID.\n               The corresponding dictionary keys are `replyCode`, `replyText`, `classID` and\n               `methodID` respectively.  An alias method _onClose_ is also provided.\n\n3) _onError_: called when an error code has been sent to the _Connection_ and is passed\n              the error code and any accompanying data in the frame\n\n4) _onFailedReconnect_: called when all reconnection attempts have been exhausted\n\n```tcl\npackage require rmq\n\n# Arguments: username password vhost\nset login [Login new -user \"guest\" -pass \"guest\" -vhost \"/\"]\n\n# Pass the login object created above to the Connection\n# constructor\nset conn [Connection new -host localhost -port 5672 -login $login]\n\n$conn onConnected rmq_connected\n$conn onClosed rmq_closed\n$conn onError rmq_connection_error\n\nproc rmq_connected {rmqConn} {\n    # do useful things\n}\n\nproc rmq_closed {rmqConn closeD} {\n    # do other useful things\n}\n\nproc rmq_error {rmqConn frameType frameData} {\n    # do even more useful things\n}\n```\n\n## Channel Callbacks\n\n_Channel_ objects have a few specific callbacks that can be set along with a more general\ncallback mechanism for the majority of AMQP method calls.\n\n### Specific Callbacks\n\nThe specific callbacks provided for _Channel_ objects mirror those available for _Connection_\nobjects.  They are:\n\n1) _onOpen_: called when the channel is open and ready to use, i.e., when the Channel.Open-Ok\n             method is received from the RabbitMQ server and is passed the same arguments as\n             the _onConnected_ callback for Connection objects\n\n2) _onClose_: called when the channel has been fully closed, i.e., when the Channel.Close-Ok\n              method is received from the RabbitMQ server and is passed the _Channel_ object\n              and the same dictionary passed to the _onClosed_ callback for _Connection_ objects\n\n3) _onError_: called when the channel receives an error, i.e., a frame is received for the\n              given channel but contains an AMQP error code and is passed the same arguments as\n              the _onError_ callback for Connection objects\n\n### General Callback Mechanism\n\nOther than the above callbacks, a Channel object can be supplied a callback for every method that\ncan be sent in response to an AMQP method by using the _on_ method of Channel objects.\n\nThese callbacks are passed the Channel object they were set on unless otherwise specified in the\nfull method documentation found below.\n\nWhen specifying the name of the AMQP method the callback will be invoked on, start with a lowercase\nletter and use camel case.  All AMQP methods documented in the \n[RabbitMQ 0-9-1 extended specification](https://www.rabbitmq.com/resources/specs/amqp0-9-1.extended.xml)\nare available.  \n\n```tcl\n# Asumming a channel object by name rmqChan exists\n$rmqChan on exchangeDeclareOk exchange_declared\n$rmqChan on queueDeclareOk queue_declared\n$rmqChan on queueBindOk queue_bound\n\n$rmqChan exchangeDeclare \"the_best_exchange\" \"fanout\"\nvwait exchangeDelcared\n\n$rmqChan queueDeclare \"the_best_queue\"\nvwait queueDeclared\n\n$rmqChan queueBind \"the_best_queue\" \"the_best_exchange\" \"the_best_routing_key\"\n\nproc exchange_delcared {rmqChan} {\n    set ::exchangeDeclared 1\n}\n\nproc queue_declared {rmqChan} {\n    set ::queueDeclared 1\n}\n\nproc queue_bound {rmqChan} {\n    set ::queueBound 1\n}\n```\n\n### The Exception of Consuming\n\nWhen consuming messages from a queue using either _Basic.Consume_ or _Basic.Get_, the process of\nsetting a callback and the data passed into the callback differs from every other case.\n\nFor consuming, the Channel object methods _basicConsume_ and _basicGet_ take the name of the callback\ninvoked for each message delivered and then their arguments.  The callbacks get passed in the\nChannel object, a dictionary of method data, a dictionary of frame data, and the data from the queue.\n\n```tcl\n# Assuming a channel object by name rmqChan exists\n$rmqChan basicConsume consume_callback \"the_best_queue\"\n\nproc consume_callback {rmqChan methodD frameD data} {\n    # Can inspect the consumer tag and dispatch on it\n    switch [dict get $methodD consumerTag] {\n        # useful things\n    }\n\n    # Can get the delivery tag to ack the message\n    $rmqChan basicAck [dict get $methodD deliveryTag]\n\n    # Frame data includes things like the data body size\n    # and is likely less immediately useful but it is\n    # passed in because it might be necessary for a given\n    # application\n}\n```\n\n#### Consuming From Multiple Queues\n\nFor a given channel, multiple queues can be consumed from and each queue can be given its own callback proc by passing in (or allowing the server to generate) a distinct _consumerTag_ for each invocation of _basicConsume_.  Otherwise, dispatching based on the method or frame metadata allows a single callback proc to customize the handling of messages from different queues.  When the client application is not constrained in its use of channels, instantiating multiple _Channel_ objects is a straight-forward way for one consumer to concurrently pull data from more than one queue.\n\n### Method Data\n\nThe dictionary of method data passed as the second argument to consumer callbacks contains the following items:\n\n* __consumerTag__\n\n    The string consumer tag, either specified at the time _basicConsume_ is called, or auto-generated by the server.\n\n* __deliveryTag__\n\n    Integer numbering for the message being consumed.  This is used for the _basicAck_ or _basicNack_ methods.\n\n* __redelivered__\n\n    Boolean integer.\n\n* __exchange__\n\n    Name of the exchange the message came from.\n\n* __routingKey__\n\n    Routing key used for delivery of the message.\n\n### Frame Data\n\nThe dictionary of frame data passed as the third argument to consumer callbacks contains the following items:\n\n* __classID__\n\n    AMQP defined integer for the class used for delivering the message.\n\n* __bodySize__\n\n    Size in bytes for the data consumed from the queue.\n\n* __properties__\n\n    Dictionary of AMQP [Basic method properties](https://www.rabbitmq.com/amqp-0-9-1-reference.html), e.g., \n    _correlation-id_, _timestamp_ or _content-type_.\n\n# Special Arguments\n\n## Flags\n\nFor AMQP methods like _queueDeclare_ or _exchangeDeclare_ which take flags, these are passed in as a list of\nconstants.  All supported flags are mentioned in the documentation below detailing each _Channel_ method.  \nWithin the source, supported flag constants are found in [constants.tcl](package/constants.tcl#L102-L130).\n\n## Properties / Headers\n\nFor AMQP class methods which take properties and/or headers, e.g., _basicConsume_, _basicPublish_, or _exchangeDeclare_, the \nproperties and headers are passed in as a Tcl dict.  The library takes care of encoding them properly.\n\n# Library Documentation\n\nAll methods defined for _Connection_, _Login_, and _Channel_ classes are detailed below.  Only includes methods that are\npart of the public interface for each object.  Any additional methods found in the source are meant to be called internally.\n\n## _Connection_ Class\n\nClass for connecting to a RabbitMQ server.\n\n### constructor\n\nThe constructor takes the following arguments (all optional):\n\n* __-host__\n\n    Defaults to localhost\n\n* __-port__\n\n    Defaults to 5672\n\n* __-tls__\n\n    Either 0 or 1, but defaults to 0.  Controls whether to connect to the RabbitMQ server using TLS. To set\n    TLS options, e.g., if using a client cert, call the _tlsOptions_ method before invoking _connect_.\n\n* __-login__\n\n    _Login_ object.  Defaults to calling the Login constructor with no arguments.\n\n* __-frameMax__\n\n    Maximum frame size in bytes.  Defaults to the value offered by the RabbitMQ server in _Connection.Tune_.\n\n* __-maxChannels__\n\n    Maximum number of channels available for this connection.  Defaults to no imposed limit, which is essentially 65,535.\n\n* __-locale__\n\n    Defaults to en_US.\n\n* __-heartbeatSecs__\n\n    Interval in seconds for sending out heartbeat frames.  Defaults to 60 seconds. A value of 0 means no heartbeats will be sent.\n\n* __-blockedConnections__\n\n    Either 0 or 1, but defaults to 1.  Controls whether to use this [RabbitMQ extension](https://www.rabbitmq.com/connection-blocked.html).\n\n* __-cancelNotifications__\n\n    Either 0 or 1, but deafults to 1.  Controls whether to use this [RabbitMQ extension](https://www.rabbitmq.com/specification.html).\n\n* __-maxTimeout__\n\n    Integer seconds to wait before timing out the connection attempt to the server.  Defaults to 3.\n\n* __-autoReconnect__\n\n    Either 0 or 1, but defaults to 1.  Controls whether the library attempts to reconnect to the RabbitMQ server when the initial call to _Connection.connect_ fails or an established socket connection is closed by the server or by network conditions.\n\n* __-maxBackoff__\n\n    Integer number of seconds past which [exponential backoff](https://cloud.google.com/storage/docs/exponential-backoff), which is the reconnection strategy employed, will not go.  Defaults to 64 seconds.\n\n* __-maxReconnects__\n\n    Integer number of reconnects to attempt before giving up.  Defaults to 5.  A value of 0 means infinite reconnects.  To disable retries, pass _-autoReconnect_ as 0.\n\n* __-debug__\n\n    Either 0 or 1, but defaults to 0.  Controls whether or not debug statements are passed to `-logCommand` detailing the operations of the library.\n\n* __-logCommand__\n\n    If the `-debug` option is true, the value of this argument will be passed debugging statements detailing the operations of the library.  The specified `-logCommand` must take a string argument containing a single debugging statement.  Defaults to `puts stderr`.\n\n### attemptReconnect\n\nTakes no arguments.  Using the _-maxBackoff_ and _-maxReconnects_ constructor arguments, attempts to reconnect to the server.  If this cannot be done, and an _onFailedReconnect_ callback has been set, it is invoked.\n\n### closeConnection\n\nTakes an optional boolean argument controlling whether the _onClose_ callback is invoked (defaults to true).  Closes the connection and, if specified, calls any callback set with _onClose_.  This is not meant to \nbe called externally as it does not uses the AMQP protocol for closing the channel.  Instead, _connectionClose_ should be used in client applications.\n\n### connect\n\nTakes no arguments.  Actually initiates a socket connection with the RabbitMQ server.  If the connection fails the _onClose_ callback is invoked.\nTwo timeouts can potentially occur in this method: one during the TCP handshake and one during the AMQP handshake.  In both cases, the _-maxTimeout_ variable is used.  Returns 1 if a connection is fully established, or 0 otherwise.\n\n### connected?\n\nTakes no arguments.  Returns 0 or 1 depending on whether the socket connection to the server has been established and an AMQP handshake completed.  It is only true once both those conditions have been satisfied.  In the event that a connection fails, the `getSocket` method can be used to obtain and query the socket channel and determine whether the problem is network or protocol based.\n\n### getSocket\n\nTakes no arguments.  Returns the socket object for communicating with the server.  This allows for more fine-grained inspection and tuning if\nso desired.\n\n### onBlocked \n\nTakes the name of a callback proc which will be used for [blocked connection notifications](https://www.rabbitmq.com/connection-blocked.html).\nBlocked connection notifications are always requested by this library, but the setting of a callback is optional.  The callback takes\nthe _Connection_ object, a boolean for whether the connection is blocked (this callback is also used when the connection is no longer\nblocked), and a textual reason why.\n\n### onClose\n\nTakes the name of a callback proc which will be called when the connection is closed.  This includes a failed connection to the RabbitMQ server when\nfirst calling _connect_ and a disconnection after establishing communication with the RabbitMQ server.  The callback takes the _Connection_\nobject and a dictionary with the keys specified in the documentation to the _onClosed_ callback.\n\n### onClosed\n\nAlias for _onClose_ method.\n\n### onConnected\n\nTakes the name of a callback proc which will be used when the AMQP handshake is finished.  When this callback is invoked, the _Connection_\nobject is ready to create channels and perform useful work.       \n\n### onError\n\nTakes the name of a callback proc used when an error is reported by the RabbitMQ server on the connection level.  The callback proc takes\nthe _Connection_ object, a frame type and any extra data included in the frame.\n\n### onFailedReconnect\n\nTakes the name of a callback proc used when the maximum number of connection attempts have been made without sucess.  The callback proc takes the __Connection__ object.\n\n### removeCallbacks\n\nTakes an optional boolean _channelsToo_, which defaults to 0.  Unsets all callbacks for the _Connection_ object.  If _channelsToo_ is 1, also unsets callbacks on all of its channels. \n\n### reconnecting?\n\nTakes no argument.  Returns 0 or 1 depending on whether the _Connection_ is in the process of attempting a reconnect.\n\n### resetRetries\n\nTakes no arguments.  Sets the count of connection retries back to 0.  Useful in cases where _-autoReconnect_ is true and more fine-grained control of the retry loop is desired.  Internally the retry count is reset to 0 when the AMQP handshake completes.\n\n### tlsOptions\n\nUsed to setup the parameters for an SSL / TLS connection to the RabbitMQ server.  \nSupports all arguments supported by the Tcl tls package's `::tls::import::` command\nas specified in the [Tcl TLS documentation](https://core.tcl.tk/tcltls/wiki/Documentation).\n\nIf a TLS connection is desired, this method needs to be called before _connect_.\n\n## _Login_ Class\n\n### constructor\n\nThe constructor takes the following arguments (all optional):\n\n* __-user__\n\n    Username to login with.  Defaults to guest\n\n* __-pass__\n\n    Password to login with.  Defaults to guest\n\n* __-mechanism__\n\n    Authentication mechanism to use.  Defaults to PLAIN\n\n* __-vhost__\n\n    Virtual host to login to.  Defaults to /\n\n### saslResponse\n\nTakes no arguments.  This method needs to overridden if an alternative mechanism is desired.\n\n## _Channel_ Class\n\nMost of the methods made available by this library come from the _Channel_ class.  It implements the majority of the AMQP methods.\n\n### constructor\n\nTakes the following arguments:\n\n* __connectionObj__\n\n    The _Connection_ object to open a channel for.  This is the only required argument.\n\n* __channelNum__\n\n    The channel number to open.  Optional.  If not specified, the next available number starting from 1 will be used.  Passing in an\n    empty string or 0 is equivalent to not providing this argument, i.e., the class will pick the next available channel number for the \n    _Connection_ object provided.\n\n* __shouldOpen__\n\n    A boolean argument that defaults to 1.  If set to 1 the channel will open after it is created.  If not, the _channelOpen_ method must be\n    called manually before anything can be done with the _Channel_ object.\n\n### active?\n\nTakes no arguments and returns 1 if the channel is active, i.e., it has been opened successfully, and 0 otherwise.\n\n### closeChannel\n\nNot meant to be called externally.  Instead, this method is used internally by the library to properly set the _Channel_ object's state before\nand after calling the _onClose_ callback.\n\n### closeConnection\n\nTakes an optional boolean argument, _callCloseCB_, which defaults to 1.  Closes the associated _Connection_ object and if _callCloseCB_ is true, any callback set with the _Connection_ object's _onClose_ method is invoked, otherwise it is ignored.\n\n### closing?\n\nTakes no arguments and returns 1 if the _Channel_ is in the process of closing and 0 otherwise.\n\n### getChannelNum\n\nTakes no arguments, and returns the channel number.\n\n### getConnection\n\nTakes no arguments, and returns the _Connection_ object passed into the constructor.\n\n### open?\n \nAlias for _active?_.\n\n### on\n\nTakes an AMQP method name in camel case, starting with a lower case letter and the name of a callback proc for the method.  To unset a callback, set its callback proc to the empty string or use _removeCallback_.\n\n### onClose\n\nTakes the name of a callback proc to be called when the channel is closed.  The callback takes the _Channel_ object and a dictionary\nof data, which is specified in the section about _onClose_ callbacks.\n\n### onClosed\n\nAlias for _onClose_.\n\n### onError\n\nTakes the name of a callback proc invoked when an error occurs on this particular _Channel_ object.  The error callback is passed\nthe _Channel_ object, a numeric error code as returned from the server, and any additional data passed back.  Errors occur on a channel\nwhen the server returns an unexpected response but not when a disconnection occurs or the channel is closed forcefully by the server.\n\n### onOpen\n\nTakes the name of a callback proc to be called when the channel successfully opens.  Once it is open, AMQP methods can be called.\nThe callback takes the _Channel_ object.\n\n### onOpened\n\nAlias for _onOpen_.\n\n### reconnecting?\n\nTakes no arguments.  Returns 1 if _Connection_ is in the process of attempting a reconnect and 0 otherwise.\n\n### removeCallback\n\nTakes the name of an AMQP method as defined on a _Channel_ object.  \n\n### removeCallbacks\n\nTakes no arguments.  Sets all callbacks to the empty string, effectively removing them.\n\n### setCallback\n\nTakes the name of an AMQP method as defined on a _Channel_ object (or for the _on_ Channel method).  The preferred method to use is _on_, but this is alternative method for setting a callback.  To unset a callback, set its callback proc to the empty string or use _removeCallback_.\n\n## _Channel_ AMQP Methods\n\nThe following methods are defined on _Channel_ objects and implement the methods and classes detailed in the \n[AMQP specification](https://www.rabbitmq.com/resources/specs/amqp-xml-doc0-9-1.pdf).\n\n### Channel Methods\n\n#### channelClose\n\nTakes the following arguments:\n\n* __replyCode__\n\n    Numeric reply code for closing the channel as specified in the AMQP specification.\n\n* __replyText__\n\n    Textual description of the reply code.\n\n* __classID__\n\n    AMQP class ID number.\n\n* __methodID__\n\n    AMQP method ID number.\n\nTo place a callback for the closing of a channel, use the _onClose_ or _onClosed_ method.  The callback takes the _Channel_ object\nand a dictionary of data with key names matching the arguments listed above.\n\n#### channelOpen\n\nTakes no arguments.\n\nTo place a callback for the opening of a channel use the _onOpen_ method.  The callback takes only the _Channel_ object.\n\n### Exchange Methods\n\n#### exchangeBind\n\nTakes the following arguments:\n\n* __dst__\n \n    Destination exchange name.\n\n* __src__\n\n    Source exchange name.\n\n* __rKey__\n\n    Routing key for the exchange binding.\n\n* __noWait__\n\n    Boolean integer, which defaults to 0.\n\n* __eArgs__\n\n    Exchange binding arguments (optional).  Passed in as a dict.  Defaults to an empty dict.\n\nTo set a callback for exchange to exchange bindings use the _on_ method with _exchangeBindOk_ as the first argument.\nCallback only takes the _Channel_ object.\n\n#### exchangeDeclare\n\nTakes the following arguments:\n\n* __eName__\n\n    Exchange name.\n\n* __eType__\n\n    Exchange type: direct, fanout, header, topic\n\n* __eFlags__\n\n    Optional flags.  Flags supported (all in the ::rmq namespace): \n\n    - EXCHANGE_PASSIVE\n\n    - EXCHANGE_DURABLE \n\n    - EXCHANGE_AUTO_DELETE\n\n    - EXCHANGE_INTERNAL\n\n    - EXCHANGE_NO_WAIT\n\n* __eArgs__\n\n    Optional dict of exchange declare arguments. \n\nTo set a callback on an exchange declaration, use the _on_ method with _exchangeDeclareOk_ as the first argument.\nCallback only takes the _Channel_ object.\n\n#### exchangeDelete\n\nTakes the following arguments:\n\n* __eName__\n\n    Exchange name to delete.\n\n* __inUse__\n\n    Optional boolean argument defaults to 0.  If set to 1, will not delete an exchange with bindings on it.\n\n* __noWait__\n\n    Optional boolean argument defaults to 0.  \n\nTo set a callback on the exchange deletion, use the _on_ method with _exchangeDeleteOk_ as the first argument.\nCallback only takes the _Channel_ object.\n\n#### exchangeUnbind\n\nTakes the same arguments as _exchangeBind_, with the same callback data.\n\n### Queue Methods\n\n#### queueBind\n\nTakes the following arguments:\n\n* __qName__\n\n    Queue name.\n\n* __eName__\n\n    Exchange name.\n\n* __rKey__\n\n    Routing key (optional).  Defaults to the empty string.\n\n* __noWait__\n\n    Boolean integer (optional).  Defaults to 0.\n\n* __qArgs__\n\n    Queue binding arguments (optional).  Needs to be passed in as a dict.  Defaults to an empty dict.\n\nTo set a callback on a queue binding, use the _on_ method with _queueBindOk_ as the first argument.\nCallback only takes the _Channel_ object.\n\n#### queueDeclare\n\nTakes the following arguments:\n\n* __qName__\n\n    Queue name.\n\n* __qFlags__\n\n    Optional list of queue declare flags.  Supports the following flag constants (in the ::rmq namespace):\n\n    - QUEUE_PASSIVE \n\n    - QUEUE_DURABLE \n\n    - QUEUE_EXCLUSIVE \n\n    - QUEUE_AUTO_DELETE \n\n    - QUEUE_DECLARE_NO_WAIT\n\n* __qArgs__\n\n    Optional dictionary of queue declare arguments.  Allows for setting features like TTLs, max lengths or a single consumer policy.\n\nTo set a callback on a queue declare, use the _on_ method with _queueDeclareOk_ as the first argument.\nCallback takes the _Channel_ object, the queue name (especially important for exclusive queues), message count,\nnumber of consumers on the queue.\n\n#### queueDelete\n\nTakes the following arguments:\n\n* __qName__\n\n    Queue name.\n\n* __flags__\n\n    Optional list of flags.  Supported flags (in the ::rmq namespace):\n\n\n    - QUEUE_IF_UNUSED \n\n    - QUEUE_IF_EMPTY \n\n    - QUEUE_DELETE_NO_WAIT\n\nTo set a callback on a queue delete, use the _on_ method with _queueDeleteOk_ as the first argument.\nCallback takes the _Channel_ object and a message count from the delete queue.\n\n#### queuePurge\n\nTakes the following arguments:\n\n* __qName__\n\n    Queue name.\n\n* __noWait__\n\n    Optional boolean argument.  Defaults to 0.\n\nTo set a callback on a queue purge, use the _on_ method with _queuePurgeOk_ as the first argument.\nCallback takes the _Channel_ object and a message count from the purged queue.\n\n#### queueUnbind\n\nTakes the following arguments:\n\n* __qName__\n\n    Queue name.\n\n* __eName__\n\n    Exchange name.\n\n* __rKey__\n\n    Routing key.\n\n* __qArgs__\n\n    Optional queue arguments.  Passed in as a dict.\n\nTo set a callback on a queue unbinding, use the _on_ method with _queueUnbindOk_ as the first argument.\nCallback takes only the _Channel_ object.\n\n### Basic Methods\n\n#### basicAck\n\nTakes the following arguments:\n\n* __deliveryTag__\n\n    Delivery tag being acknowledged.\n\n* __multiple__\n\n    Optional boolean, defaults to 0.  If set to 1, all messages up to and including the _deliveryTag_ argument's value.\n\nSetting a callback on this method using the _on_ method is for publisher confirms.  The callback takes the _Channel_\nobject, a delivery tag and a multiple boolean.\n\n#### basicCancel\n\nTakes the following arguments:\n\n* __cTag__\n\n    Consumer tag.\n\n* __noWait__\n\n    Optional boolean argument.  Defaults to 0.\n\nTo set a callback on a basic cancel, use the _on_ method with _basicCancelOk_ as the first argument.\nCallback takes the _Channel_ object and the consumer tag that was canceled.\n\n#### basicConsume\n\nTakes the following arguments:\n\n* __callback__\n\n    Name of a callback to use for consuming messages.  The callback takes the _Channel_ object, a dict of method data, a dict of\n    frame data and the data from the queue.\n\n* __qName__\n\n    Queue name to consume from.\n\n* __cTag__\n\n    Optional consumer tag.\n\n* __cFlags__\n\n    Optional list of flags.  Supported flags (all in the ::rmq namespace):\n\n    - CONSUME_NO_LOCAL\n\n    - CONSUME_NO_ACK\n\n    - CONSUME_EXCLUSIVE\n\n    - CONSUME_NO_WAIT\n\n* __cArgs__\n\n    Optional arguments to control consuming.  Passed in as a dict.  Supports all arguments specified for the\n    [basic class](https://www.rabbitmq.com/amqp-0-9-1-reference.html).\n\nCallback is set directly from this method.\n\n#### basicGet\n\nTakes the following arguments:\n\n* __callback__\n\n    Name of a callback proc using the same arguments as that for _basicConsume_.\n\n* __qName__\n\n    Queue name to get a message from\n\n* __noWait__\n\n    Optional boolean.  Defaults to 0.\n\nLike with _basicConsume_ the callback for this method is set directly from the method call.\n\n#### basicNack\n\nTakes the following arguments:\n\n* __deliveryTag__\n\n    Delivery tag for message being nack'ed.\n\n* __nackFlags__\n\n    Optional list of flags.  Supports the following (in the ::rmq namespace):\n\n    - NACK_MULTIPLE\n\n    - NACK_REQUEUE\n\nSetting a callback on this method using the _on_ method is for publisher confirms.  The callback takes the _Channel_\nobject, a delivery tag and a multiple boolean.\n\n#### basicQos\n\nTakes the following arguments:\n\n* __prefetchCount__\n\n    Integer prefetch count, i.e., the number of unacknowledged messages that can be delivered to a consumer at one time.\n\n* __globalQos__\n\n    Optional boolean which defaults to 0.  If set to 1, the prefecth count is set globally [for all consumers on the channel](https://www.rabbitmq.com/consumer-prefetch.html).\n\nTo set a callback on a basic QOS call, use the _on_ method with _basicQosOk_ as the first argument.\nCallback takes only the _Channel_ object.\n\n#### basicPublish\n\nTakes the following arguments:\n\n* __data__\n\n    The data to publish to the queue.\n\n* __eName__\n\n    Exchange name.\n\n* __rKey__\n\n    Routing key.\n\n* __pFlags__\n\n    Optional list of flags.  Supports the following flags (in the ::rmq namespace):\n\n    - PUBLISH_MANDATORY \n\n    - PUBLISH_IMMEDIATE\n\nNo callback can be set on this directly.  For [publisher confirms](https://www.rabbitmq.com/confirms.html)\nuse the _on_ method with _basicAck_ as the first argument.  That callback takes the _Channel_ object,\nthe delivery tag and a boolean for whether the ack is for multiple messages.\n\n#### basicRecover\n\nSame as _basicRecoverAsync_.\n\n### Confirm Methods\n\n#### confirmSelect\n\nTakes the following arguments:\n\n* __noWait__\n\n    Optional boolean argument, defaults to 0.\n\nTo set a callback on a confirm select call, use the _on_ method with _confirmSelectOk_ as the first argument.\nCallback takes the _Channel_ object.\n\n#### basicRecoverAsync\n\nTakes the following arguments:\n\n* __reQueue__\n\n    Boolean argument.  If 0, the message will be redelivered to the original recipient.  If 1, an\n    alternate recipient can get the redelivery.\n\nTo set a callback on a basic recover, use the _on_ method with _basicRecoverOk_ as the first argument.\nCallback takes the _Channel_ object. \n\n#### basicReject\n\nTakes the following arguments:\n\n* __deliveryTag__\n\n    Delivery tag of message being rejected by the client.\n\n* __reQueue__\n\n    Optional boolean argument, defaults to 0.  If set to 1, the rejected message will be requeued.\n\n#### basicReturn\n\nThis method is not to be called directly, but to use a callback to handle returned messages, use the _on_ method\nwith _basicReturn_ as the first argument.  The callback takes the same arguments as the _basicConsume_ callback.\n\n### TX Methods\n\n#### txSelect\n\nTakes no arguments.\n\nTo set a callback on a transaction select call, use the _on_ method with _txSelectOk_ as the first argument.\nCallback takes the _Channel_ object.\n\n#### txCommit\n\nTakes no arguments.\n\nTo set a callback on a transaction commit call, use the _on_ method with _txCommitOk_ as the first argument.\nCallback takes the _Channel_ object.\n\n#### txRollback\n\nTakes no arguments.\n\nTo set a callback on a transaction commit call, use the _on_ method with _txRollbackOk_ as the first argument.\nCallback takes the _Channel_ object.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflightaware%2Ftclrmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflightaware%2Ftclrmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflightaware%2Ftclrmq/lists"}