Package: haigha
Version:0.9.0Download:http://pypi.python.org/pypi/haighaSource:https://github.com/agoragames/haighaKeywords:python, amqp, rabbitmq, event, libevent, geventOverviewDocumentationExampleRoadmapInstallationTestingBug trackerLicenseOverviewHaigha provides a simple to use client library for interacting with AMQP brokers. It currently supports the 0.9.1 protocol and is integration tested against the latest RabbitMQ 2.8.1 (seeerrata). Haigha is a descendant ofpy-amqpliband owes much to its developers.The goals of haigha are performance, simplicity, and adherence to the form and function of the AMQP protocol. It adds a few useful features, such as theChannelPoolclass andChannel.publish_synchronous, to ease use of powerful features in real-world applications.By default, Haigha operates in a completely asynchronous mode, relying on callbacks to notify application code of responses from the broker. Where applicable,nowaitdefaults toTrue. The application code is welcome to call a series of methods, and Haigha will manage the stack and synchronous handshakes in the event loop.Starting with the 0.5.0 series, haigha natively supports 3 transport types; libevent, gevent and standard sockets. The socket implementation defaults to synchronous mode and is useful for an interactive console or scripting, and the gevent transport is the preferred asynchronous backend though it can also be used synchronously as well.DocumentationThis file and the various files in thescriptsdirectory serve as a simple introduction to haigha. For more complete documentation, seeDOCUMENTATION.rst.ExampleSee thescriptsandexamplesdirectories for several examples, in particular thestress_testscript which you can use to test the performance of haigha against your broker. Below is a simple example of a client that connects, processes one message and quits.from haigha.connection import Connection
from haigha.message import Message

connection = Connection(
  user='guest', password='guest',
  vhost='/', host='localhost',
  heartbeat=None, debug=True)

ch = connection.channel()
ch.exchange.declare('test_exchange', 'direct')
ch.queue.declare('test_queue', auto_delete=True)
ch.queue.bind('test_queue', 'test_exchange', 'test_key')
ch.basic.publish( Message('body', application_headers={'hello':'world'}),
  'test_exchange', 'test_key' )
print ch.basic.get('test_queue')
connection.close()To use protocol extensions for RabbitMQ, initialize the connection with thehaigha.connections.rabbit_connection.RabbitConnectionclass.RoadmapDocumentation (there’s always more)Improved error handlingImplementation of error codes in the specTesting and integration with brokers other than RabbitMQIdentify and improve inefficient codeEdge cases in frame managementImprovements to usabililtySSLAllow nowait when asynchronous transport but Connection put into synchronous mode.Haigha has been tested exclusively with Python 2.6 and 2.7, but we intend for it to work with the 3.x series as well. Pleasereportany issues you may have.InstallationHaigha is available onpypiand can be installed usingpippip install haighaIf installing from source:with development requirements (e.g. testing frameworks)pip install -r development.txtwithout development requirementspip install -r requirements.txtNote that haigha does not install either gevent or libevent support automatically. For libevent, haigha has been tested and deployed with theevent-agora==0.4.1library.TestingUnit tests can be run with either the included script, or withnose./haigha$ scripts/test
./haigha$ nosetestsThere are two other testing scripts of note.rabbit_table_testis a simple integration test that confirms compliance with RabbitMQerrata. Thestress_testscript is a valuable tool that offers load-testing capability similar toApache BenchorSiege. It is used both to confirm the robustness of haigha, as well as benchmark hardware or a broker configuration.Bug trackerIf you have any suggestions, bug reports or annoyances please report them
to our issue tracker athttps://github.com/agoragames/haigha/issuesLicenseThis software is licensed under theNew BSD License. See theLICENSE.txtfile in the top distribution directory for the full license text.