Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update celery and djcelery to 2.5.5

  • Loading branch information...
commit ebf374dc5cf9679abceecd4672ca780bf2eec51a 1 parent 2f55087
Giorgos Logiotatidis glogiotatidis authored
Showing with 13,015 additions and 5,634 deletions.
  1. +3 −3 vendor-local/bin/camqadm
  2. +3 −3 vendor-local/bin/celerybeat
  3. +3 −3 vendor-local/bin/celeryctl
  4. +3 −3 vendor-local/bin/celeryd
  5. +3 −3 vendor-local/bin/celeryd-multi
  6. +3 −3 vendor-local/bin/celeryev
  7. +3 −3 vendor-local/bin/djcelerymon
  8. +22 −0 vendor-local/lib/python/amqplib-1.0.2.egg-info/PKG-INFO
  9. +38 −0 vendor-local/lib/python/amqplib-1.0.2.egg-info/SOURCES.txt
  10. +1 −0  vendor-local/lib/python/amqplib-1.0.2.egg-info/dependency_links.txt
  11. +25 −0 vendor-local/lib/python/amqplib-1.0.2.egg-info/installed-files.txt
  12. +1 −0  vendor-local/lib/python/amqplib-1.0.2.egg-info/top_level.txt
  13. +1 −0  vendor-local/lib/python/amqplib/__init__.py
  14. +36 −0 vendor-local/lib/python/amqplib/client_0_8/__init__.py
  15. +124 −0 vendor-local/lib/python/amqplib/client_0_8/abstract_channel.py
  16. +132 −0 vendor-local/lib/python/amqplib/client_0_8/basic_message.py
  17. +2,694 −0 vendor-local/lib/python/amqplib/client_0_8/channel.py
  18. +842 −0 vendor-local/lib/python/amqplib/client_0_8/connection.py
  19. +105 −0 vendor-local/lib/python/amqplib/client_0_8/exceptions.py
  20. +261 −0 vendor-local/lib/python/amqplib/client_0_8/method_framing.py
  21. +541 −0 vendor-local/lib/python/amqplib/client_0_8/serialization.py
  22. +281 −0 vendor-local/lib/python/amqplib/client_0_8/transport.py
  23. +365 −0 vendor-local/lib/python/celery-2.5.5.egg-info/PKG-INFO
  24. +468 −0 vendor-local/lib/python/celery-2.5.5.egg-info/SOURCES.txt
  25. +1 −0  vendor-local/lib/python/celery-2.5.5.egg-info/dependency_links.txt
  26. +11 −0 vendor-local/lib/python/celery-2.5.5.egg-info/entry_points.txt
  27. +406 −0 vendor-local/lib/python/celery-2.5.5.egg-info/installed-files.txt
  28. +1 −0  vendor-local/lib/python/celery-2.5.5.egg-info/not-zip-safe
  29. +5 −0 vendor-local/lib/python/celery-2.5.5.egg-info/requires.txt
  30. +1 −0  vendor-local/lib/python/celery-2.5.5.egg-info/top_level.txt
  31. +12 −13 vendor-local/lib/python/celery/__init__.py
  32. +1 −2  vendor-local/lib/python/celery/abstract.py
  33. +73 −53 vendor-local/lib/python/celery/app/__init__.py
  34. +14 −11 vendor-local/lib/python/celery/app/amqp.py
  35. +55 −73 vendor-local/lib/python/celery/app/base.py
  36. +50 −12 vendor-local/lib/python/celery/app/defaults.py
  37. +45 −36 vendor-local/lib/python/celery/app/task/__init__.py
  38. +18 −20 vendor-local/lib/python/celery/apps/beat.py
  39. +70 −78 vendor-local/lib/python/celery/apps/worker.py
  40. +16 −10 vendor-local/lib/python/celery/backends/__init__.py
  41. +8 −11 vendor-local/lib/python/celery/backends/amqp.py
  42. +24 −14 vendor-local/lib/python/celery/backends/base.py
  43. +22 −8 vendor-local/lib/python/celery/backends/cache.py
  44. +44 −32 vendor-local/lib/python/celery/backends/cassandra.py
  45. +3 −4 vendor-local/lib/python/celery/backends/database.py
  46. +68 −4 vendor-local/lib/python/celery/backends/mongodb.py
  47. +28 −12 vendor-local/lib/python/celery/backends/redis.py
  48. +17 −14 vendor-local/lib/python/celery/beat.py
  49. +12 −3 vendor-local/lib/python/celery/bin/base.py
  50. +4 −1 vendor-local/lib/python/celery/bin/camqadm.py
  51. +5 −1 vendor-local/lib/python/celery/bin/celerybeat.py
  52. +187 −35 vendor-local/lib/python/celery/bin/celeryctl.py
  53. +24 −30 vendor-local/lib/python/celery/bin/celeryd.py
  54. +11 −5 vendor-local/lib/python/celery/bin/celeryd_detach.py
  55. +12 −11 vendor-local/lib/python/celery/bin/celeryd_multi.py
  56. +3 −0  vendor-local/lib/python/celery/bin/celeryev.py
  57. +5 −5 vendor-local/lib/python/celery/concurrency/__init__.py
  58. +22 −48 vendor-local/lib/python/celery/concurrency/base.py
  59. +7 −5 vendor-local/lib/python/celery/concurrency/eventlet.py
  60. +16 −4 vendor-local/lib/python/celery/concurrency/gevent.py
  61. +43 −16 vendor-local/lib/python/celery/concurrency/processes/__init__.py
  62. +2 −2 vendor-local/lib/python/celery/concurrency/processes/_win.py
  63. +100 −43 vendor-local/lib/python/celery/concurrency/processes/pool.py
  64. +5 −9 vendor-local/lib/python/celery/concurrency/solo.py
  65. +1 −1  vendor-local/lib/python/celery/contrib/abortable.py
  66. +2 −2 vendor-local/lib/python/celery/contrib/batches.py
  67. +2 −2 vendor-local/lib/python/celery/contrib/rdb.py
  68. +242 −74 vendor-local/lib/python/celery/datastructures.py
  69. +4 −6 vendor-local/lib/python/celery/db/a805d4bd.py
  70. +4 −6 vendor-local/lib/python/celery/db/dfd042c7.py
  71. +3 −3 vendor-local/lib/python/celery/db/models.py
  72. +8 −7 vendor-local/lib/python/celery/decorators.py
  73. +20 −31 vendor-local/lib/python/celery/events/__init__.py
  74. +27 −10 vendor-local/lib/python/celery/events/cursesmon.py
  75. +2 −2 vendor-local/lib/python/celery/events/dumper.py
  76. +3 −2 vendor-local/lib/python/celery/events/snapshot.py
  77. +1 −1  vendor-local/lib/python/celery/events/state.py
  78. +17 −1 vendor-local/lib/python/celery/exceptions.py
  79. +0 −21 vendor-local/lib/python/celery/execute/__init__.py
  80. +219 −100 vendor-local/lib/python/celery/execute/trace.py
  81. +4 −4 vendor-local/lib/python/celery/loaders/__init__.py
  82. +1 −1  vendor-local/lib/python/celery/loaders/app.py
  83. +16 −4 vendor-local/lib/python/celery/loaders/base.py
  84. +21 −2 vendor-local/lib/python/celery/loaders/default.py
  85. +13 −2 vendor-local/lib/python/celery/local.py
  86. +48 −20 vendor-local/lib/python/celery/log.py
  87. +144 −40 vendor-local/lib/python/celery/platforms.py
  88. +1 −8 vendor-local/lib/python/celery/registry.py
  89. +35 −62 vendor-local/lib/python/celery/result.py
  90. +5 −2 vendor-local/lib/python/celery/routes.py
  91. +26 −17 vendor-local/lib/python/celery/schedules.py
  92. +3 −1 vendor-local/lib/python/celery/signals.py
  93. +12 −29 vendor-local/lib/python/celery/task/__init__.py
  94. +2 −18 vendor-local/lib/python/celery/task/base.py
  95. +16 −12 vendor-local/lib/python/celery/task/chords.py
  96. +1 −1  vendor-local/lib/python/celery/task/control.py
  97. +11 −12 vendor-local/lib/python/celery/task/http.py
  98. +15 −61 vendor-local/lib/python/celery/task/sets.py
  99. +0 −2  vendor-local/lib/python/celery/tests/compat.py
  100. +16 −0 vendor-local/lib/python/celery/tests/config.py
  101. +7 −6 vendor-local/lib/python/celery/tests/functional/case.py
  102. +9 −8 vendor-local/lib/python/celery/tests/test_app/__init__.py
  103. +9 −2 vendor-local/lib/python/celery/tests/test_app/test_app_defaults.py
  104. +7 −6 vendor-local/lib/python/celery/tests/test_app/test_beat.py
  105. +2 −2 vendor-local/lib/python/celery/tests/test_app/test_celery.py
  106. +14 −25 vendor-local/lib/python/celery/tests/test_app/test_loaders.py
  107. +3 −4 vendor-local/lib/python/celery/tests/test_app/test_log.py
  108. +20 −14 vendor-local/lib/python/celery/tests/test_app/test_routes.py
  109. +2 −2 vendor-local/lib/python/celery/tests/test_backends/__init__.py
  110. +6 −3 vendor-local/lib/python/celery/tests/test_backends/test_amqp.py
  111. +12 −10 vendor-local/lib/python/celery/tests/test_backends/test_base.py
  112. +62 −37 vendor-local/lib/python/celery/tests/test_backends/test_cache.py
  113. +4 −5 vendor-local/lib/python/celery/tests/test_backends/test_database.py
  114. +2 −2 vendor-local/lib/python/celery/tests/test_backends/test_pyredis_compat.py
  115. +3 −4 vendor-local/lib/python/celery/tests/test_backends/test_redis.py
  116. +17 −3 vendor-local/lib/python/celery/tests/test_backends/test_redis_unit.py
  117. +2 −2 vendor-local/lib/python/celery/tests/test_backends/test_tyrant.py
  118. +6 −3 vendor-local/lib/python/celery/tests/test_bin/__init__.py
  119. +16 −21 vendor-local/lib/python/celery/tests/test_bin/test_celeryd.py
  120. +2 −3 vendor-local/lib/python/celery/tests/test_bin/test_celeryev.py
  121. +2 −6 vendor-local/lib/python/celery/tests/test_compat/test_decorators.py
  122. +2 −2 vendor-local/lib/python/celery/tests/test_compat/test_messaging.py
  123. +8 −2 vendor-local/lib/python/celery/tests/test_concurrency/__init__.py
  124. +3 −4 vendor-local/lib/python/celery/tests/test_concurrency/test_concurrency_eventlet.py
  125. +37 −53 vendor-local/lib/python/celery/tests/test_concurrency/test_concurrency_processes.py
  126. +2 −3 vendor-local/lib/python/celery/tests/test_concurrency/test_concurrency_solo.py
  127. +2 −2 vendor-local/lib/python/celery/tests/test_concurrency/test_pool.py
  128. +5 −5 vendor-local/lib/python/celery/tests/test_events/__init__.py
  129. +2 −2 vendor-local/lib/python/celery/tests/test_events/test_events_cursesmon.py
  130. +3 −3 vendor-local/lib/python/celery/tests/test_events/test_events_snapshot.py
  131. +4 −4 vendor-local/lib/python/celery/tests/test_events/test_events_state.py
  132. +5 −5 vendor-local/lib/python/celery/tests/test_slow/test_buckets.py
  133. +22 −28 vendor-local/lib/python/celery/tests/test_task/__init__.py
  134. +44 −17 vendor-local/lib/python/celery/tests/test_task/test_chord.py
  135. +2 −2 vendor-local/lib/python/celery/tests/test_task/test_context.py
  136. +62 −12 vendor-local/lib/python/celery/tests/test_task/test_execute_trace.py
  137. +2 −2 vendor-local/lib/python/celery/tests/test_task/test_registry.py
  138. +19 −12 vendor-local/lib/python/celery/tests/test_task/test_result.py
  139. +2 −2 vendor-local/lib/python/celery/tests/test_task/test_states.py
  140. +2 −2 vendor-local/lib/python/celery/tests/test_task/test_task_abortable.py
  141. +3 −42 vendor-local/lib/python/celery/tests/test_task/test_task_builtins.py
  142. +10 −5 vendor-local/lib/python/celery/tests/test_task/test_task_control.py
  143. +5 −5 vendor-local/lib/python/celery/tests/test_task/test_task_http.py
  144. +3 −27 vendor-local/lib/python/celery/tests/test_task/test_task_sets.py
  145. +18 −49 vendor-local/lib/python/celery/tests/test_utils/__init__.py
  146. +98 −12 vendor-local/lib/python/celery/tests/test_utils/test_datastructures.py
  147. +2 −2 vendor-local/lib/python/celery/tests/test_utils/test_pickle.py
  148. +2 −3 vendor-local/lib/python/celery/tests/test_utils/test_serialization.py
  149. +8 −17 vendor-local/lib/python/celery/tests/test_utils/test_timer2.py
  150. +2 −2 vendor-local/lib/python/celery/tests/test_utils/test_utils_encoding.py
  151. +2 −2 vendor-local/lib/python/celery/tests/test_utils/test_utils_info.py
  152. +8 −8 vendor-local/lib/python/celery/tests/test_utils/test_utils_timeutils.py
  153. +68 −31 vendor-local/lib/python/celery/tests/test_worker/__init__.py
  154. +14 −9 vendor-local/lib/python/celery/tests/test_worker/test_worker_autoscale.py
  155. +76 −14 vendor-local/lib/python/celery/tests/test_worker/test_worker_control.py
  156. +5 −2 vendor-local/lib/python/celery/tests/test_worker/test_worker_heartbeat.py
  157. +111 −86 vendor-local/lib/python/celery/tests/test_worker/test_worker_job.py
  158. +18 −10 vendor-local/lib/python/celery/tests/test_worker/test_worker_mediator.py
  159. +2 −2 vendor-local/lib/python/celery/tests/test_worker/test_worker_revoke.py
  160. +2 −2 vendor-local/lib/python/celery/tests/test_worker/test_worker_state.py
  161. +133 −3 vendor-local/lib/python/celery/tests/utils.py
  162. +72 −89 vendor-local/lib/python/celery/utils/__init__.py
  163. +6 −1 vendor-local/lib/python/celery/utils/compat.py
  164. +0 −2  vendor-local/lib/python/celery/utils/dispatch/saferef.py
  165. +26 −13 vendor-local/lib/python/celery/utils/dispatch/signal.py
  166. +7 −1 vendor-local/lib/python/celery/utils/encoding.py
  167. +1 −1  vendor-local/lib/python/celery/utils/functional.py
  168. +1 −1  vendor-local/lib/python/celery/utils/mail.py
  169. +1 −1  vendor-local/lib/python/celery/utils/patch.py
  170. +1 −1  vendor-local/lib/python/celery/utils/serialization.py
  171. +6 −3 vendor-local/lib/python/celery/utils/term.py
  172. +2 −1  vendor-local/lib/python/celery/utils/threads.py
  173. +17 −6 vendor-local/lib/python/celery/utils/timer2.py
  174. +66 −13 vendor-local/lib/python/celery/utils/timeutils.py
  175. +185 −204 vendor-local/lib/python/celery/worker/__init__.py
  176. +20 −12 vendor-local/lib/python/celery/worker/autoreload.py
  177. +25 −31 vendor-local/lib/python/celery/worker/autoscale.py
  178. +18 −16 vendor-local/lib/python/celery/worker/buckets.py
  179. +60 −45 vendor-local/lib/python/celery/worker/consumer.py
  180. +1 −3 vendor-local/lib/python/celery/worker/control.py
  181. +12 −5 vendor-local/lib/python/celery/worker/heartbeat.py
  182. +245 −328 vendor-local/lib/python/celery/worker/job.py
  183. +32 −35 vendor-local/lib/python/celery/worker/mediator.py
  184. +5 −7 vendor-local/lib/python/celery/worker/state.py
  185. +191 −0 vendor-local/lib/python/django_celery-2.5.5.egg-info/PKG-INFO
  186. +139 −0 vendor-local/lib/python/django_celery-2.5.5.egg-info/SOURCES.txt
  187. +1 −0  vendor-local/lib/python/django_celery-2.5.5.egg-info/dependency_links.txt
  188. +3 −0  vendor-local/lib/python/django_celery-2.5.5.egg-info/entry_points.txt
  189. +113 −0 vendor-local/lib/python/django_celery-2.5.5.egg-info/installed-files.txt
  190. +1 −0  vendor-local/lib/python/django_celery-2.5.5.egg-info/not-zip-safe
  191. +2 −0  vendor-local/lib/python/django_celery-2.5.5.egg-info/requires.txt
  192. +1 −0  vendor-local/lib/python/django_celery-2.5.5.egg-info/top_level.txt
  193. +7 −2 vendor-local/lib/python/djcelery/__init__.py
  194. +2 −1  vendor-local/lib/python/djcelery/admin.py
  195. +4 −4 vendor-local/lib/python/djcelery/admin_utils.py
  196. +1 −1  vendor-local/lib/python/djcelery/contrib/test_runner.py
  197. +69 −0 vendor-local/lib/python/djcelery/humanize.py
  198. +10 −5 vendor-local/lib/python/djcelery/loaders.py
  199. +47 −2 vendor-local/lib/python/djcelery/management/base.py
  200. +1 −0  vendor-local/lib/python/djcelery/management/commands/celeryctl.py
  201. +10 −1 vendor-local/lib/python/djcelery/models.py
  202. +16 −6 vendor-local/lib/python/djcelery/mon.py
  203. +4 −0 vendor-local/lib/python/djcelery/schedulers.py
  204. +1 −1  vendor-local/lib/python/djcelery/tests/test_loaders.py
  205. +3 −65 vendor-local/lib/python/djcelery/utils.py
  206. +2 −3 vendor-local/lib/python/djcelery/views.py
  207. +338 −0 vendor-local/lib/python/kombu-2.1.8.egg-info/PKG-INFO
  208. +212 −0 vendor-local/lib/python/kombu-2.1.8.egg-info/SOURCES.txt
  209. +1 −0  vendor-local/lib/python/kombu-2.1.8.egg-info/dependency_links.txt
  210. +171 −0 vendor-local/lib/python/kombu-2.1.8.egg-info/installed-files.txt
  211. +1 −0  vendor-local/lib/python/kombu-2.1.8.egg-info/not-zip-safe
  212. +2 −0  vendor-local/lib/python/kombu-2.1.8.egg-info/requires.txt
  213. +1 −0  vendor-local/lib/python/kombu-2.1.8.egg-info/top_level.txt
  214. +33 −48 vendor-local/lib/python/kombu/__init__.py
  215. +20 −18 vendor-local/lib/python/kombu/abstract.py
  216. +6 −36 vendor-local/lib/python/kombu/clocks.py
  217. +80 −200 vendor-local/lib/python/kombu/common.py
  218. +35 −34 vendor-local/lib/python/kombu/compat.py
  219. +8 −5 vendor-local/lib/python/kombu/compression.py
  220. +150 −365 vendor-local/lib/python/kombu/connection.py
  221. +54 −206 vendor-local/lib/python/kombu/entity.py
  222. +8 −9 vendor-local/lib/python/kombu/exceptions.py
  223. +11 −11 vendor-local/lib/python/kombu/log.py
  224. +57 −116 vendor-local/lib/python/kombu/messaging.py
  225. +31 −25 vendor-local/lib/python/kombu/mixins.py
  226. +99 −130 vendor-local/lib/python/kombu/pidbox.py
  227. +14 −23 vendor-local/lib/python/kombu/pools.py
  228. +29 −75 vendor-local/lib/python/kombu/serialization.py
  229. +12 −6 vendor-local/lib/python/kombu/simple.py
  230. +10 −16 vendor-local/lib/python/kombu/syn.py
  231. +16 −16 vendor-local/lib/python/kombu/tests/__init__.py
  232. +10 −10 vendor-local/lib/python/kombu/tests/compat.py
  233. +28 −36 vendor-local/lib/python/kombu/tests/mocks.py
  234. +0 −27 vendor-local/lib/python/kombu/tests/test_clocks.py
  235. +49 −225 vendor-local/lib/python/kombu/tests/test_common.py
  236. +88 −88 vendor-local/lib/python/kombu/tests/test_compat.py
  237. +11 −11 vendor-local/lib/python/kombu/tests/test_compression.py
  238. +101 −268 vendor-local/lib/python/kombu/tests/test_connection.py
  239. +66 −181 vendor-local/lib/python/kombu/tests/test_entities.py
  240. +41 −41 vendor-local/lib/python/kombu/tests/test_log.py
  241. +147 −179 vendor-local/lib/python/kombu/tests/test_messaging.py
  242. +56 −57 vendor-local/lib/python/kombu/tests/test_pidbox.py
  243. +21 −49 vendor-local/lib/python/kombu/tests/test_pools.py
  244. +43 −43 vendor-local/lib/python/kombu/tests/test_serialization.py
  245. +23 −23 vendor-local/lib/python/kombu/tests/test_simple.py
  246. +20 −137 vendor-local/lib/python/kombu/tests/test_utils.py
  247. +38 −56 vendor-local/lib/python/kombu/tests/transport/test_amqplib.py
  248. +13 −13 vendor-local/lib/python/kombu/tests/transport/test_base.py
  249. +23 −19 vendor-local/lib/python/kombu/tests/transport/test_memory.py
  250. +22 −46 vendor-local/lib/python/kombu/tests/transport/test_mongodb.py
Sorry, we could not display the entire diff because it was too big.
6 vendor-local/bin/camqadm
View
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.4.0','console_scripts','camqadm'
-__requires__ = 'celery==2.4.0'
+# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.5.5','console_scripts','camqadm'
+__requires__ = 'celery==2.5.5'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
- load_entry_point('celery==2.4.0', 'console_scripts', 'camqadm')()
+ load_entry_point('celery==2.5.5', 'console_scripts', 'camqadm')()
)
6 vendor-local/bin/celerybeat
View
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.4.0','console_scripts','celerybeat'
-__requires__ = 'celery==2.4.0'
+# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.5.5','console_scripts','celerybeat'
+__requires__ = 'celery==2.5.5'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
- load_entry_point('celery==2.4.0', 'console_scripts', 'celerybeat')()
+ load_entry_point('celery==2.5.5', 'console_scripts', 'celerybeat')()
)
6 vendor-local/bin/celeryctl
View
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.4.0','console_scripts','celeryctl'
-__requires__ = 'celery==2.4.0'
+# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.5.5','console_scripts','celeryctl'
+__requires__ = 'celery==2.5.5'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
- load_entry_point('celery==2.4.0', 'console_scripts', 'celeryctl')()
+ load_entry_point('celery==2.5.5', 'console_scripts', 'celeryctl')()
)
6 vendor-local/bin/celeryd
View
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.4.0','console_scripts','celeryd'
-__requires__ = 'celery==2.4.0'
+# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.5.5','console_scripts','celeryd'
+__requires__ = 'celery==2.5.5'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
- load_entry_point('celery==2.4.0', 'console_scripts', 'celeryd')()
+ load_entry_point('celery==2.5.5', 'console_scripts', 'celeryd')()
)
6 vendor-local/bin/celeryd-multi
View
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.4.0','console_scripts','celeryd-multi'
-__requires__ = 'celery==2.4.0'
+# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.5.5','console_scripts','celeryd-multi'
+__requires__ = 'celery==2.5.5'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
- load_entry_point('celery==2.4.0', 'console_scripts', 'celeryd-multi')()
+ load_entry_point('celery==2.5.5', 'console_scripts', 'celeryd-multi')()
)
6 vendor-local/bin/celeryev
View
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.4.0','console_scripts','celeryev'
-__requires__ = 'celery==2.4.0'
+# EASY-INSTALL-ENTRY-SCRIPT: 'celery==2.5.5','console_scripts','celeryev'
+__requires__ = 'celery==2.5.5'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
- load_entry_point('celery==2.4.0', 'console_scripts', 'celeryev')()
+ load_entry_point('celery==2.5.5', 'console_scripts', 'celeryev')()
)
6 vendor-local/bin/djcelerymon
View
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# EASY-INSTALL-ENTRY-SCRIPT: 'django-celery==2.5.0','console_scripts','djcelerymon'
-__requires__ = 'django-celery==2.5.0'
+# EASY-INSTALL-ENTRY-SCRIPT: 'django-celery==2.5.5','console_scripts','djcelerymon'
+__requires__ = 'django-celery==2.5.5'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
- load_entry_point('django-celery==2.5.0', 'console_scripts', 'djcelerymon')()
+ load_entry_point('django-celery==2.5.5', 'console_scripts', 'djcelerymon')()
)
22 vendor-local/lib/python/amqplib-1.0.2.egg-info/PKG-INFO
View
@@ -0,0 +1,22 @@
+Metadata-Version: 1.0
+Name: amqplib
+Version: 1.0.2
+Summary: AMQP Client Library
+Home-page: http://code.google.com/p/py-amqplib/
+Author: Barry Pederson
+Author-email: bp@barryp.org
+License: LGPL
+Description: UNKNOWN
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.4
+Classifier: Programming Language :: Python :: 2.5
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.0
+Classifier: Programming Language :: Python :: 3.1
+Classifier: Programming Language :: Python :: 3.2
+Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
+Classifier: Intended Audience :: Developers
38 vendor-local/lib/python/amqplib-1.0.2.egg-info/SOURCES.txt
View
@@ -0,0 +1,38 @@
+CHANGES
+INSTALL
+LICENSE
+MANIFEST.in
+README
+TODO
+setup.cfg
+setup.py
+amqplib/__init__.py
+amqplib.egg-info/PKG-INFO
+amqplib.egg-info/SOURCES.txt
+amqplib.egg-info/dependency_links.txt
+amqplib.egg-info/top_level.txt
+amqplib/client_0_8/__init__.py
+amqplib/client_0_8/abstract_channel.py
+amqplib/client_0_8/basic_message.py
+amqplib/client_0_8/channel.py
+amqplib/client_0_8/connection.py
+amqplib/client_0_8/exceptions.py
+amqplib/client_0_8/method_framing.py
+amqplib/client_0_8/serialization.py
+amqplib/client_0_8/transport.py
+demo/amqp_clock.py
+demo/demo_receive.py
+demo/demo_send.py
+docs/code_layout.txt
+docs/overview.txt
+extras/README
+extras/generate_skeleton_0_8.py
+tests/client_0_8/fake_redirect.py
+tests/client_0_8/run_all.py
+tests/client_0_8/settings.py
+tests/client_0_8/test_basic_message.py
+tests/client_0_8/test_channel.py
+tests/client_0_8/test_connection.py
+tests/client_0_8/test_exceptions.py
+tests/client_0_8/test_serialization.py
+tests/client_0_8/test_with.py
1  vendor-local/lib/python/amqplib-1.0.2.egg-info/dependency_links.txt
View
@@ -0,0 +1 @@
+
25 vendor-local/lib/python/amqplib-1.0.2.egg-info/installed-files.txt
View
@@ -0,0 +1,25 @@
+../amqplib/__init__.py
+../amqplib/client_0_8/transport.py
+../amqplib/client_0_8/abstract_channel.py
+../amqplib/client_0_8/exceptions.py
+../amqplib/client_0_8/basic_message.py
+../amqplib/client_0_8/connection.py
+../amqplib/client_0_8/__init__.py
+../amqplib/client_0_8/method_framing.py
+../amqplib/client_0_8/serialization.py
+../amqplib/client_0_8/channel.py
+../amqplib/__init__.pyc
+../amqplib/client_0_8/transport.pyc
+../amqplib/client_0_8/abstract_channel.pyc
+../amqplib/client_0_8/exceptions.pyc
+../amqplib/client_0_8/basic_message.pyc
+../amqplib/client_0_8/connection.pyc
+../amqplib/client_0_8/__init__.pyc
+../amqplib/client_0_8/method_framing.pyc
+../amqplib/client_0_8/serialization.pyc
+../amqplib/client_0_8/channel.pyc
+./
+top_level.txt
+SOURCES.txt
+PKG-INFO
+dependency_links.txt
1  vendor-local/lib/python/amqplib-1.0.2.egg-info/top_level.txt
View
@@ -0,0 +1 @@
+amqplib
1  vendor-local/lib/python/amqplib/__init__.py
View
@@ -0,0 +1 @@
+
36 vendor-local/lib/python/amqplib/client_0_8/__init__.py
View
@@ -0,0 +1,36 @@
+"""
+AMQP Client implementing the 0-8 spec.
+
+"""
+# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+
+#
+# Pull in the public items from the various sub-modules
+#
+from basic_message import *
+from channel import *
+from connection import *
+from exceptions import *
+
+__all__ = [
+ 'Connection',
+ 'Channel', # here mainly so it shows in in pydoc
+ 'Message',
+ 'AMQPException',
+ 'AMQPConnectionException',
+ 'AMQPChannelException',
+ ]
124 vendor-local/lib/python/amqplib/client_0_8/abstract_channel.py
View
@@ -0,0 +1,124 @@
+"""
+Code common to Connection and Channel objects.
+
+"""
+# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+
+from serialization import AMQPWriter
+
+try:
+ bytes
+except NameError:
+ # Python 2.5 and lower
+ bytes = str
+
+__all__ = [
+ 'AbstractChannel',
+ ]
+
+
+class AbstractChannel(object):
+ """
+ Superclass for both the Connection, which is treated
+ as channel 0, and other user-created Channel objects.
+
+ The subclasses must have a _METHOD_MAP class property, mapping
+ between AMQP method signatures and Python methods.
+
+ """
+ def __init__(self, connection, channel_id):
+ self.connection = connection
+ self.channel_id = channel_id
+ connection.channels[channel_id] = self
+ self.method_queue = [] # Higher level queue for methods
+ self.auto_decode = False
+
+
+ def __enter__(self):
+ """
+ Support for Python >= 2.5 'with' statements.
+
+ """
+ return self
+
+
+ def __exit__(self, type, value, traceback):
+ """
+ Support for Python >= 2.5 'with' statements.
+
+ """
+ self.close()
+
+
+ def _send_method(self, method_sig, args=bytes(), content=None):
+ """
+ Send a method for our channel.
+
+ """
+ if isinstance(args, AMQPWriter):
+ args = args.getvalue()
+
+ self.connection.method_writer.write_method(self.channel_id,
+ method_sig, args, content)
+
+
+ def close(self):
+ """
+ Close this Channel or Connection
+
+ """
+ raise NotImplementedError('Must be overriden in subclass')
+
+
+
+ def wait(self, allowed_methods=None):
+ """
+ Wait for a method that matches our allowed_methods parameter (the
+ default value of None means match any method), and dispatch to it.
+
+ """
+ method_sig, args, content = self.connection._wait_method(
+ self.channel_id, allowed_methods)
+
+ return self.dispatch_method(method_sig, args, content)
+
+
+ def dispatch_method(self, method_sig, args, content):
+ if content \
+ and self.auto_decode \
+ and hasattr(content, 'content_encoding'):
+ try:
+ content.body = content.body.decode(content.content_encoding)
+ except Exception:
+ pass
+
+ amqp_method = self._METHOD_MAP.get(method_sig, None)
+
+ if amqp_method is None:
+ raise Exception('Unknown AMQP method (%d, %d)' % method_sig)
+
+ if content is None:
+ return amqp_method(self, args)
+ else:
+ return amqp_method(self, args, content)
+
+
+ #
+ # Placeholder, the concrete implementations will have to
+ # supply their own versions of _METHOD_MAP
+ #
+ _METHOD_MAP = {}
132 vendor-local/lib/python/amqplib/client_0_8/basic_message.py
View
@@ -0,0 +1,132 @@
+"""
+Messages for AMQP
+
+"""
+# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+
+
+from serialization import GenericContent
+
+__all__ = [
+ 'Message',
+ ]
+
+
+class Message(GenericContent):
+ """
+ A Message for use with the Channnel.basic_* methods.
+
+ """
+ #
+ # Instances of this class have these attributes, which
+ # are passed back and forth as message properties between
+ # client and server
+ #
+ PROPERTIES = [
+ ('content_type', 'shortstr'),
+ ('content_encoding', 'shortstr'),
+ ('application_headers', 'table'),
+ ('delivery_mode', 'octet'),
+ ('priority', 'octet'),
+ ('correlation_id', 'shortstr'),
+ ('reply_to', 'shortstr'),
+ ('expiration', 'shortstr'),
+ ('message_id', 'shortstr'),
+ ('timestamp', 'timestamp'),
+ ('type', 'shortstr'),
+ ('user_id', 'shortstr'),
+ ('app_id', 'shortstr'),
+ ('cluster_id', 'shortstr')
+ ]
+
+ def __init__(self, body='', children=None, **properties):
+ """
+ Expected arg types
+
+ body: string
+ children: (not supported)
+
+ Keyword properties may include:
+
+ content_type: shortstr
+ MIME content type
+
+ content_encoding: shortstr
+ MIME content encoding
+
+ application_headers: table
+ Message header field table, a dict with string keys,
+ and string | int | Decimal | datetime | dict values.
+
+ delivery_mode: octet
+ Non-persistent (1) or persistent (2)
+
+ priority: octet
+ The message priority, 0 to 9
+
+ correlation_id: shortstr
+ The application correlation identifier
+
+ reply_to: shortstr
+ The destination to reply to
+
+ expiration: shortstr
+ Message expiration specification
+
+ message_id: shortstr
+ The application message identifier
+
+ timestamp: datetime.datetime
+ The message timestamp
+
+ type: shortstr
+ The message type name
+
+ user_id: shortstr
+ The creating user id
+
+ app_id: shortstr
+ The creating application id
+
+ cluster_id: shortstr
+ Intra-cluster routing identifier
+
+ Unicode bodies are encoded according to the 'content_encoding'
+ argument. If that's None, it's set to 'UTF-8' automatically.
+
+ example:
+
+ msg = Message('hello world',
+ content_type='text/plain',
+ application_headers={'foo': 7})
+
+ """
+ super(Message, self).__init__(**properties)
+ self.body = body
+
+
+ def __eq__(self, other):
+ """
+ Check if the properties and bodies of this Message and another
+ Message are the same.
+
+ Received messages may contain a 'delivery_info' attribute,
+ which isn't compared.
+
+ """
+ return super(Message, self).__eq__(other) \
+ and hasattr(other, 'body') and (self.body == other.body)
2,694 vendor-local/lib/python/amqplib/client_0_8/channel.py
View
@@ -0,0 +1,2694 @@
+"""
+AMQP 0-8 Channels
+
+"""
+# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+
+import logging
+from Queue import Queue
+
+from abstract_channel import AbstractChannel
+from exceptions import *
+from serialization import AMQPWriter
+
+__all__ = [
+ 'Channel', # here mainly so it shows in in pydoc
+ ]
+
+AMQP_LOGGER = logging.getLogger('amqplib')
+
+
+class Channel(AbstractChannel):
+ """
+ work with channels
+
+ The channel class provides methods for a client to establish a
+ virtual connection - a channel - to a server and for both peers to
+ operate the virtual connection thereafter.
+
+ GRAMMAR:
+
+ channel = open-channel *use-channel close-channel
+ open-channel = C:OPEN S:OPEN-OK
+ use-channel = C:FLOW S:FLOW-OK
+ / S:FLOW C:FLOW-OK
+ / S:ALERT
+ / functional-class
+ close-channel = C:CLOSE S:CLOSE-OK
+ / S:CLOSE C:CLOSE-OK
+
+ """
+ def __init__(self, connection, channel_id=None, auto_decode=True):
+ """
+ Create a channel bound to a connection and using the specified
+ numeric channel_id, and open on the server.
+
+ The 'auto_decode' parameter (defaults to True), indicates
+ whether the library should attempt to decode the body
+ of Messages to a Unicode string if there's a 'content_encoding'
+ property for the message. If there's no 'content_encoding'
+ property, or the decode raises an Exception, the message body
+ is left as plain bytes.
+
+ """
+ if channel_id is None:
+ channel_id = connection._get_free_channel_id()
+ AMQP_LOGGER.debug('using channel_id: %d' % channel_id)
+
+ super(Channel, self).__init__(connection, channel_id)
+
+ self.default_ticket = 0
+ self.is_open = False
+ self.active = True # Flow control
+ self.alerts = Queue()
+ self.returned_messages = Queue()
+ self.callbacks = {}
+ self.auto_decode = auto_decode
+
+ self._x_open()
+
+
+ def _do_close(self):
+ """
+ Tear down this object, after we've agreed to close with the server.
+
+ """
+ AMQP_LOGGER.debug('Closed channel #%d' % self.channel_id)
+ self.is_open = False
+ del self.connection.channels[self.channel_id]
+ self.channel_id = self.connection = None
+ self.callbacks = {}
+
+
+ #################
+
+ def _alert(self, args):
+ """
+ This method allows the server to send a non-fatal warning to
+ the client. This is used for methods that are normally
+ asynchronous and thus do not have confirmations, and for which
+ the server may detect errors that need to be reported. Fatal
+ errors are handled as channel or connection exceptions; non-
+ fatal errors are sent through this method.
+
+ PARAMETERS:
+ reply_code: short
+
+ The reply code. The AMQ reply codes are defined in AMQ
+ RFC 011.
+
+ reply_text: shortstr
+
+ The localised reply text. This text can be logged as an
+ aid to resolving issues.
+
+ details: table
+
+ detailed information for warning
+
+ A set of fields that provide more information about
+ the problem. The meaning of these fields are defined
+ on a per-reply-code basis (TO BE DEFINED).
+
+ """
+ reply_code = args.read_short()
+ reply_text = args.read_shortstr()
+ details = args.read_table()
+
+ self.alerts.put((reply_code, reply_text, details))
+
+
+ def close(self, reply_code=0, reply_text='', method_sig=(0, 0)):
+ """
+ request a channel close
+
+ This method indicates that the sender wants to close the
+ channel. This may be due to internal conditions (e.g. a forced
+ shut-down) or due to an error handling a specific method, i.e.
+ an exception. When a close is due to an exception, the sender
+ provides the class and method id of the method which caused
+ the exception.
+
+ RULE:
+
+ After sending this method any received method except
+ Channel.Close-OK MUST be discarded.
+
+ RULE:
+
+ The peer sending this method MAY use a counter or timeout
+ to detect failure of the other peer to respond correctly
+ with Channel.Close-OK..
+
+ PARAMETERS:
+ reply_code: short
+
+ The reply code. The AMQ reply codes are defined in AMQ
+ RFC 011.
+
+ reply_text: shortstr
+
+ The localised reply text. This text can be logged as an
+ aid to resolving issues.
+
+ class_id: short
+
+ failing method class
+
+ When the close is provoked by a method exception, this
+ is the class of the method.
+
+ method_id: short
+
+ failing method ID
+
+ When the close is provoked by a method exception, this
+ is the ID of the method.
+
+ """
+ if not self.is_open:
+ # already closed
+ return
+
+ args = AMQPWriter()
+ args.write_short(reply_code)
+ args.write_shortstr(reply_text)
+ args.write_short(method_sig[0]) # class_id
+ args.write_short(method_sig[1]) # method_id
+ self._send_method((20, 40), args)
+ return self.wait(allowed_methods=[
+ (20, 41), # Channel.close_ok
+ ])
+
+
+ def _close(self, args):
+ """
+ request a channel close
+
+ This method indicates that the sender wants to close the
+ channel. This may be due to internal conditions (e.g. a forced
+ shut-down) or due to an error handling a specific method, i.e.
+ an exception. When a close is due to an exception, the sender
+ provides the class and method id of the method which caused
+ the exception.
+
+ RULE:
+
+ After sending this method any received method except
+ Channel.Close-OK MUST be discarded.
+
+ RULE:
+
+ The peer sending this method MAY use a counter or timeout
+ to detect failure of the other peer to respond correctly
+ with Channel.Close-OK..
+
+ PARAMETERS:
+ reply_code: short
+
+ The reply code. The AMQ reply codes are defined in AMQ
+ RFC 011.
+
+ reply_text: shortstr
+
+ The localised reply text. This text can be logged as an
+ aid to resolving issues.
+
+ class_id: short
+
+ failing method class
+
+ When the close is provoked by a method exception, this
+ is the class of the method.
+
+ method_id: short
+
+ failing method ID
+
+ When the close is provoked by a method exception, this
+ is the ID of the method.
+
+ """
+ reply_code = args.read_short()
+ reply_text = args.read_shortstr()
+ class_id = args.read_short()
+ method_id = args.read_short()
+
+# self.close_ok()
+
+
+# def close_ok(self):
+# """
+# confirm a channel close
+#
+# This method confirms a Channel.Close method and tells the
+# recipient that it is safe to release resources for the channel
+# and close the socket.
+#
+# RULE:
+#
+# A peer that detects a socket closure without having
+# received a Channel.Close-Ok handshake method SHOULD log
+# the error.
+#
+# """
+ self._send_method((20, 41))
+ self._do_close()
+
+ raise AMQPChannelException(reply_code, reply_text,
+ (class_id, method_id))
+
+
+ def _close_ok(self, args):
+ """
+ confirm a channel close
+
+ This method confirms a Channel.Close method and tells the
+ recipient that it is safe to release resources for the channel
+ and close the socket.
+
+ RULE:
+
+ A peer that detects a socket closure without having
+ received a Channel.Close-Ok handshake method SHOULD log
+ the error.
+
+ """
+ self._do_close()
+
+
+ def flow(self, active):
+ """
+ enable/disable flow from peer
+
+ This method asks the peer to pause or restart the flow of
+ content data. This is a simple flow-control mechanism that a
+ peer can use to avoid oveflowing its queues or otherwise
+ finding itself receiving more messages than it can process.
+ Note that this method is not intended for window control. The
+ peer that receives a request to stop sending content should
+ finish sending the current content, if any, and then wait
+ until it receives a Flow restart method.
+
+ RULE:
+
+ When a new channel is opened, it is active. Some
+ applications assume that channels are inactive until
+ started. To emulate this behaviour a client MAY open the
+ channel, then pause it.
+
+ RULE:
+
+ When sending content data in multiple frames, a peer
+ SHOULD monitor the channel for incoming methods and
+ respond to a Channel.Flow as rapidly as possible.
+
+ RULE:
+
+ A peer MAY use the Channel.Flow method to throttle
+ incoming content data for internal reasons, for example,
+ when exchangeing data over a slower connection.
+
+ RULE:
+
+ The peer that requests a Channel.Flow method MAY
+ disconnect and/or ban a peer that does not respect the
+ request.
+
+ PARAMETERS:
+ active: boolean
+
+ start/stop content frames
+
+ If True, the peer starts sending content frames. If
+ False, the peer stops sending content frames.
+
+ """
+ args = AMQPWriter()
+ args.write_bit(active)
+ self._send_method((20, 20), args)
+ return self.wait(allowed_methods=[
+ (20, 21), # Channel.flow_ok
+ ])
+
+
+ def _flow(self, args):
+ """
+ enable/disable flow from peer
+
+ This method asks the peer to pause or restart the flow of
+ content data. This is a simple flow-control mechanism that a
+ peer can use to avoid oveflowing its queues or otherwise
+ finding itself receiving more messages than it can process.
+ Note that this method is not intended for window control. The
+ peer that receives a request to stop sending content should
+ finish sending the current content, if any, and then wait
+ until it receives a Flow restart method.
+
+ RULE:
+
+ When a new channel is opened, it is active. Some
+ applications assume that channels are inactive until
+ started. To emulate this behaviour a client MAY open the
+ channel, then pause it.
+
+ RULE:
+
+ When sending content data in multiple frames, a peer
+ SHOULD monitor the channel for incoming methods and
+ respond to a Channel.Flow as rapidly as possible.
+
+ RULE:
+
+ A peer MAY use the Channel.Flow method to throttle
+ incoming content data for internal reasons, for example,
+ when exchangeing data over a slower connection.
+
+ RULE:
+
+ The peer that requests a Channel.Flow method MAY
+ disconnect and/or ban a peer that does not respect the
+ request.
+
+ PARAMETERS:
+ active: boolean
+
+ start/stop content frames
+
+ If True, the peer starts sending content frames. If
+ False, the peer stops sending content frames.
+
+ """
+ self.active = args.read_bit()
+
+ self._x_flow_ok(self.active)
+
+
+ def _x_flow_ok(self, active):
+ """
+ confirm a flow method
+
+ Confirms to the peer that a flow command was received and
+ processed.
+
+ PARAMETERS:
+ active: boolean
+
+ current flow setting
+
+ Confirms the setting of the processed flow method:
+ True means the peer will start sending or continue
+ to send content frames; False means it will not.
+
+ """
+ args = AMQPWriter()
+ args.write_bit(active)
+ self._send_method((20, 21), args)
+
+
+ def _flow_ok(self, args):
+ """
+ confirm a flow method
+
+ Confirms to the peer that a flow command was received and
+ processed.
+
+ PARAMETERS:
+ active: boolean
+
+ current flow setting
+
+ Confirms the setting of the processed flow method:
+ True means the peer will start sending or continue
+ to send content frames; False means it will not.
+
+ """
+ return args.read_bit()
+
+
+ def _x_open(self, out_of_band=''):
+ """
+ open a channel for use
+
+ This method opens a virtual connection (a channel).
+
+ RULE:
+
+ This method MUST NOT be called when the channel is already
+ open.
+
+ PARAMETERS:
+ out_of_band: shortstr
+
+ out-of-band settings
+
+ Configures out-of-band transfers on this channel. The
+ syntax and meaning of this field will be formally
+ defined at a later date.
+
+ """
+ if self.is_open:
+ return
+
+ args = AMQPWriter()
+ args.write_shortstr(out_of_band)
+ self._send_method((20, 10), args)
+ return self.wait(allowed_methods=[
+ (20, 11), # Channel.open_ok
+ ])
+
+
+ def _open_ok(self, args):
+ """
+ signal that the channel is ready
+
+ This method signals to the client that the channel is ready
+ for use.
+
+ """
+ self.is_open = True
+ AMQP_LOGGER.debug('Channel open')
+
+
+ #############
+ #
+ # Access
+ #
+ #
+ # work with access tickets
+ #
+ # The protocol control access to server resources using access
+ # tickets. A client must explicitly request access tickets before
+ # doing work. An access ticket grants a client the right to use a
+ # specific set of resources - called a "realm" - in specific ways.
+ #
+ # GRAMMAR:
+ #
+ # access = C:REQUEST S:REQUEST-OK
+ #
+ #
+
+ def access_request(self, realm, exclusive=False,
+ passive=False, active=False, write=False, read=False):
+ """
+ request an access ticket
+
+ This method requests an access ticket for an access realm. The
+ server responds by granting the access ticket. If the client
+ does not have access rights to the requested realm this causes
+ a connection exception. Access tickets are a per-channel
+ resource.
+
+ RULE:
+
+ The realm name MUST start with either "/data" (for
+ application resources) or "/admin" (for server
+ administration resources). If the realm starts with any
+ other path, the server MUST raise a connection exception
+ with reply code 403 (access refused).
+
+ RULE:
+
+ The server MUST implement the /data realm and MAY
+ implement the /admin realm. The mapping of resources to
+ realms is not defined in the protocol - this is a server-
+ side configuration issue.
+
+ PARAMETERS:
+ realm: shortstr
+
+ name of requested realm
+
+ RULE:
+
+ If the specified realm is not known to the server,
+ the server must raise a channel exception with
+ reply code 402 (invalid path).
+
+ exclusive: boolean
+
+ request exclusive access
+
+ Request exclusive access to the realm. If the server
+ cannot grant this - because there are other active
+ tickets for the realm - it raises a channel exception.
+
+ passive: boolean
+
+ request passive access
+
+ Request message passive access to the specified access
+ realm. Passive access lets a client get information
+ about resources in the realm but not to make any
+ changes to them.
+
+ active: boolean
+
+ request active access
+
+ Request message active access to the specified access
+ realm. Acvtive access lets a client get create and
+ delete resources in the realm.
+
+ write: boolean
+
+ request write access
+
+ Request write access to the specified access realm.
+ Write access lets a client publish messages to all
+ exchanges in the realm.
+
+ read: boolean
+
+ request read access
+
+ Request read access to the specified access realm.
+ Read access lets a client consume messages from queues
+ in the realm.
+
+ The most recently requested ticket is used as the channel's
+ default ticket for any method that requires a ticket.
+
+ """
+ args = AMQPWriter()
+ args.write_shortstr(realm)
+ args.write_bit(exclusive)
+ args.write_bit(passive)
+ args.write_bit(active)
+ args.write_bit(write)
+ args.write_bit(read)
+ self._send_method((30, 10), args)
+ return self.wait(allowed_methods=[
+ (30, 11), # Channel.access_request_ok
+ ])
+
+
+ def _access_request_ok(self, args):
+ """
+ grant access to server resources
+
+ This method provides the client with an access ticket. The
+ access ticket is valid within the current channel and for the
+ lifespan of the channel.
+
+ RULE:
+
+ The client MUST NOT use access tickets except within the
+ same channel as originally granted.
+
+ RULE:
+
+ The server MUST isolate access tickets per channel and
+ treat an attempt by a client to mix these as a connection
+ exception.
+
+ PARAMETERS:
+ ticket: short
+
+ """
+ self.default_ticket = args.read_short()
+ return self.default_ticket
+
+
+ #############
+ #
+ # Exchange
+ #
+ #
+ # work with exchanges
+ #
+ # Exchanges match and distribute messages across queues.
+ # Exchanges can be configured in the server or created at runtime.
+ #
+ # GRAMMAR:
+ #
+ # exchange = C:DECLARE S:DECLARE-OK
+ # / C:DELETE S:DELETE-OK
+ #
+ # RULE:
+ #
+ # The server MUST implement the direct and fanout exchange
+ # types, and predeclare the corresponding exchanges named
+ # amq.direct and amq.fanout in each virtual host. The server
+ # MUST also predeclare a direct exchange to act as the default
+ # exchange for content Publish methods and for default queue
+ # bindings.
+ #
+ # RULE:
+ #
+ # The server SHOULD implement the topic exchange type, and
+ # predeclare the corresponding exchange named amq.topic in
+ # each virtual host.
+ #
+ # RULE:
+ #
+ # The server MAY implement the system exchange type, and
+ # predeclare the corresponding exchanges named amq.system in
+ # each virtual host. If the client attempts to bind a queue to
+ # the system exchange, the server MUST raise a connection
+ # exception with reply code 507 (not allowed).
+ #
+ # RULE:
+ #
+ # The default exchange MUST be defined as internal, and be
+ # inaccessible to the client except by specifying an empty
+ # exchange name in a content Publish method. That is, the
+ # server MUST NOT let clients make explicit bindings to this
+ # exchange.
+ #
+ #
+
+ def exchange_declare(self, exchange, type, passive=False, durable=False,
+ auto_delete=True, internal=False, nowait=False,
+ arguments=None, ticket=None):
+ """
+ declare exchange, create if needed
+
+ This method creates an exchange if it does not already exist,
+ and if the exchange exists, verifies that it is of the correct
+ and expected class.
+
+ RULE:
+
+ The server SHOULD support a minimum of 16 exchanges per
+ virtual host and ideally, impose no limit except as
+ defined by available resources.
+
+ PARAMETERS:
+ exchange: shortstr
+
+ RULE:
+
+ Exchange names starting with "amq." are reserved
+ for predeclared and standardised exchanges. If
+ the client attempts to create an exchange starting
+ with "amq.", the server MUST raise a channel
+ exception with reply code 403 (access refused).
+
+ type: shortstr
+
+ exchange type
+
+ Each exchange belongs to one of a set of exchange
+ types implemented by the server. The exchange types
+ define the functionality of the exchange - i.e. how
+ messages are routed through it. It is not valid or
+ meaningful to attempt to change the type of an
+ existing exchange.
+
+ RULE:
+
+ If the exchange already exists with a different
+ type, the server MUST raise a connection exception
+ with a reply code 507 (not allowed).
+
+ RULE:
+
+ If the server does not support the requested
+ exchange type it MUST raise a connection exception
+ with a reply code 503 (command invalid).
+
+ passive: boolean
+
+ do not create exchange
+
+ If set, the server will not create the exchange. The
+ client can use this to check whether an exchange
+ exists without modifying the server state.
+
+ RULE:
+
+ If set, and the exchange does not already exist,
+ the server MUST raise a channel exception with
+ reply code 404 (not found).
+
+ durable: boolean
+
+ request a durable exchange
+
+ If set when creating a new exchange, the exchange will
+ be marked as durable. Durable exchanges remain active
+ when a server restarts. Non-durable exchanges
+ (transient exchanges) are purged if/when a server
+ restarts.
+
+ RULE:
+
+ The server MUST support both durable and transient
+ exchanges.
+
+ RULE:
+
+ The server MUST ignore the durable field if the
+ exchange already exists.
+
+ auto_delete: boolean
+
+ auto-delete when unused
+
+ If set, the exchange is deleted when all queues have
+ finished using it.
+
+ RULE:
+
+ The server SHOULD allow for a reasonable delay
+ between the point when it determines that an
+ exchange is not being used (or no longer used),
+ and the point when it deletes the exchange. At
+ the least it must allow a client to create an
+ exchange and then bind a queue to it, with a small
+ but non-zero delay between these two actions.
+
+ RULE:
+
+ The server MUST ignore the auto-delete field if
+ the exchange already exists.
+
+ internal: boolean
+
+ create internal exchange
+
+ If set, the exchange may not be used directly by
+ publishers, but only when bound to other exchanges.
+ Internal exchanges are used to construct wiring that
+ is not visible to applications.
+
+ nowait: boolean
+
+ do not send a reply method
+
+ If set, the server will not respond to the method. The
+ client should not wait for a reply method. If the
+ server could not complete the method it will raise a
+ channel or connection exception.
+
+ arguments: table
+
+ arguments for declaration
+
+ A set of arguments for the declaration. The syntax and
+ semantics of these arguments depends on the server
+ implementation. This field is ignored if passive is
+ True.
+
+ ticket: short
+
+ When a client defines a new exchange, this belongs to
+ the access realm of the ticket used. All further work
+ done with that exchange must be done with an access
+ ticket for the same realm.
+
+ RULE:
+
+ The client MUST provide a valid access ticket
+ giving "active" access to the realm in which the
+ exchange exists or will be created, or "passive"
+ access if the if-exists flag is set.
+
+ """
+ if arguments is None:
+ arguments = {}
+
+ args = AMQPWriter()
+ if ticket is not None:
+ args.write_short(ticket)
+ else:
+ args.write_short(self.default_ticket)
+ args.write_shortstr(exchange)
+ args.write_shortstr(type)
+ args.write_bit(passive)
+ args.write_bit(durable)
+ args.write_bit(auto_delete)
+ args.write_bit(internal)
+ args.write_bit(nowait)
+ args.write_table(arguments)
+ self._send_method((40, 10), args)
+
+ if not nowait:
+ return self.wait(allowed_methods=[
+ (40, 11), # Channel.exchange_declare_ok
+ ])
+
+
+ def _exchange_declare_ok(self, args):
+ """
+ confirms an exchange declaration
+
+ This method confirms a Declare method and confirms the name of
+ the exchange, essential for automatically-named exchanges.
+
+ """
+ pass
+
+
+ def exchange_delete(self, exchange, if_unused=False,
+ nowait=False, ticket=None):
+ """
+ delete an exchange
+
+ This method deletes an exchange. When an exchange is deleted
+ all queue bindings on the exchange are cancelled.
+
+ PARAMETERS:
+ exchange: shortstr
+
+ RULE:
+
+ The exchange MUST exist. Attempting to delete a
+ non-existing exchange causes a channel exception.
+
+ if_unused: boolean
+
+ delete only if unused
+
+ If set, the server will only delete the exchange if it
+ has no queue bindings. If the exchange has queue
+ bindings the server does not delete it but raises a
+ channel exception instead.
+
+ RULE:
+
+ If set, the server SHOULD delete the exchange but
+ only if it has no queue bindings.
+
+ RULE:
+
+ If set, the server SHOULD raise a channel
+ exception if the exchange is in use.
+
+ nowait: boolean
+
+ do not send a reply method
+
+ If set, the server will not respond to the method. The
+ client should not wait for a reply method. If the
+ server could not complete the method it will raise a
+ channel or connection exception.
+
+ ticket: short
+
+ RULE:
+
+ The client MUST provide a valid access ticket
+ giving "active" access rights to the exchange's
+ access realm.
+
+ """
+ args = AMQPWriter()
+ if ticket is not None:
+ args.write_short(ticket)
+ else:
+ args.write_short(self.default_ticket)
+ args.write_shortstr(exchange)
+ args.write_bit(if_unused)
+ args.write_bit(nowait)
+ self._send_method((40, 20), args)
+
+ if not nowait:
+ return self.wait(allowed_methods=[
+ (40, 21), # Channel.exchange_delete_ok
+ ])
+
+
+ def _exchange_delete_ok(self, args):
+ """
+ confirm deletion of an exchange
+
+ This method confirms the deletion of an exchange.
+
+ """
+ pass
+
+
+ #############
+ #
+ # Queue
+ #
+ #
+ # work with queues
+ #
+ # Queues store and forward messages. Queues can be configured in
+ # the server or created at runtime. Queues must be attached to at
+ # least one exchange in order to receive messages from publishers.
+ #
+ # GRAMMAR:
+ #
+ # queue = C:DECLARE S:DECLARE-OK
+ # / C:BIND S:BIND-OK
+ # / C:PURGE S:PURGE-OK
+ # / C:DELETE S:DELETE-OK
+ #
+ # RULE:
+ #
+ # A server MUST allow any content class to be sent to any
+ # queue, in any mix, and queue and delivery these content
+ # classes independently. Note that all methods that fetch
+ # content off queues are specific to a given content class.
+ #
+ #
+
+ def queue_bind(self, queue, exchange, routing_key='',
+ nowait=False, arguments=None, ticket=None):
+ """
+ bind queue to an exchange
+
+ This method binds a queue to an exchange. Until a queue is
+ bound it will not receive any messages. In a classic
+ messaging model, store-and-forward queues are bound to a dest
+ exchange and subscription queues are bound to a dest_wild
+ exchange.
+
+ RULE:
+
+ A server MUST allow ignore duplicate bindings - that is,
+ two or more bind methods for a specific queue, with
+ identical arguments - without treating these as an error.
+
+ RULE:
+
+ If a bind fails, the server MUST raise a connection
+ exception.
+
+ RULE:
+
+ The server MUST NOT allow a durable queue to bind to a
+ transient exchange. If the client attempts this the server
+ MUST raise a channel exception.
+
+ RULE:
+
+ Bindings for durable queues are automatically durable and
+ the server SHOULD restore such bindings after a server
+ restart.
+
+ RULE:
+
+ If the client attempts to an exchange that was declared as
+ internal, the server MUST raise a connection exception
+ with reply code 530 (not allowed).
+
+ RULE:
+
+ The server SHOULD support at least 4 bindings per queue,
+ and ideally, impose no limit except as defined by
+ available resources.
+
+ PARAMETERS:
+ queue: shortstr
+
+ Specifies the name of the queue to bind. If the queue
+ name is empty, refers to the current queue for the
+ channel, which is the last declared queue.
+
+ RULE:
+
+ If the client did not previously declare a queue,
+ and the queue name in this method is empty, the
+ server MUST raise a connection exception with
+ reply code 530 (not allowed).
+
+ RULE:
+
+ If the queue does not exist the server MUST raise
+ a channel exception with reply code 404 (not
+ found).
+
+ exchange: shortstr
+
+ The name of the exchange to bind to.
+
+ RULE:
+
+ If the exchange does not exist the server MUST
+ raise a channel exception with reply code 404 (not
+ found).
+
+ routing_key: shortstr
+
+ message routing key
+
+ Specifies the routing key for the binding. The
+ routing key is used for routing messages depending on
+ the exchange configuration. Not all exchanges use a
+ routing key - refer to the specific exchange
+ documentation. If the routing key is empty and the
+ queue name is empty, the routing key will be the
+ current queue for the channel, which is the last
+ declared queue.
+
+ nowait: boolean
+
+ do not send a reply method
+
+ If set, the server will not respond to the method. The
+ client should not wait for a reply method. If the
+ server could not complete the method it will raise a
+ channel or connection exception.
+
+ arguments: table
+
+ arguments for binding
+
+ A set of arguments for the binding. The syntax and
+ semantics of these arguments depends on the exchange
+ class.
+
+ ticket: short
+
+ The client provides a valid access ticket giving
+ "active" access rights to the queue's access realm.
+
+ """
+ if arguments is None:
+ arguments = {}
+
+ args = AMQPWriter()
+ if ticket is not None:
+ args.write_short(ticket)
+ else:
+ args.write_short(self.default_ticket)
+ args.write_shortstr(queue)
+ args.write_shortstr(exchange)
+ args.write_shortstr(routing_key)
+ args.write_bit(nowait)
+ args.write_table(arguments)
+ self._send_method((50, 20), args)
+
+ if not nowait:
+ return self.wait(allowed_methods=[
+ (50, 21), # Channel.queue_bind_ok
+ ])
+
+
+ def _queue_bind_ok(self, args):
+ """
+ confirm bind successful
+
+ This method confirms that the bind was successful.
+
+ """
+ pass
+
+
+ def queue_unbind(self, queue, exchange, routing_key='',
+ nowait=False, arguments=None, ticket=None):
+ """
+ NOTE::::This is not part of AMQP 0-8, but RabbitMQ supports this as
+ an extension
+
+ unbind a queue from an exchange
+
+ This method unbinds a queue from an exchange.
+
+ RULE:
+
+ If a unbind fails, the server MUST raise a connection exception.
+
+ PARAMETERS:
+ queue: shortstr
+
+ Specifies the name of the queue to unbind.
+
+ RULE:
+
+ The client MUST either specify a queue name or have
+ previously declared a queue on the same channel
+
+ RULE:
+
+ The client MUST NOT attempt to unbind a queue that
+ does not exist.
+
+ exchange: shortstr
+
+ The name of the exchange to unbind from.
+
+ RULE:
+
+ The client MUST NOT attempt to unbind a queue from an
+ exchange that does not exist.
+
+ RULE:
+
+ The server MUST accept a blank exchange name to mean
+ the default exchange.
+
+ routing_key: shortstr
+
+ routing key of binding
+
+ Specifies the routing key of the binding to unbind.
+
+ arguments: table
+
+ arguments of binding
+
+ Specifies the arguments of the binding to unbind.
+
+ """
+ if arguments is None:
+ arguments = {}
+
+ args = AMQPWriter()
+ if ticket is not None:
+ args.write_short(ticket)
+ else:
+ args.write_short(self.default_ticket)
+ args.write_shortstr(queue)
+ args.write_shortstr(exchange)
+ args.write_shortstr(routing_key)
+ #args.write_bit(nowait)
+ args.write_table(arguments)
+ self._send_method((50, 50), args)
+
+ if not nowait:
+ return self.wait(allowed_methods=[
+ (50, 51), # Channel.queue_unbind_ok
+ ])
+
+
+ def _queue_unbind_ok(self, args):
+ """
+ confirm unbind successful
+
+ This method confirms that the unbind was successful.
+
+ """
+ pass
+
+
+ def queue_declare(self, queue='', passive=False, durable=False,
+ exclusive=False, auto_delete=True, nowait=False,
+ arguments=None, ticket=None):
+ """
+ declare queue, create if needed
+
+ This method creates or checks a queue. When creating a new
+ queue the client can specify various properties that control
+ the durability of the queue and its contents, and the level of
+ sharing for the queue.
+
+ RULE:
+
+ The server MUST create a default binding for a newly-
+ created queue to the default exchange, which is an
+ exchange of type 'direct'.
+
+ RULE:
+
+ The server SHOULD support a minimum of 256 queues per
+ virtual host and ideally, impose no limit except as
+ defined by available resources.
+
+ PARAMETERS:
+ queue: shortstr
+
+ RULE:
+
+ The queue name MAY be empty, in which case the
+ server MUST create a new queue with a unique
+ generated name and return this to the client in
+ the Declare-Ok method.
+
+ RULE:
+
+ Queue names starting with "amq." are reserved for
+ predeclared and standardised server queues. If
+ the queue name starts with "amq." and the passive
+ option is False, the server MUST raise a connection
+ exception with reply code 403 (access refused).
+
+ passive: boolean
+
+ do not create queue
+
+ If set, the server will not create the queue. The
+ client can use this to check whether a queue exists
+ without modifying the server state.
+
+ RULE:
+
+ If set, and the queue does not already exist, the
+ server MUST respond with a reply code 404 (not
+ found) and raise a channel exception.
+
+ durable: boolean
+
+ request a durable queue
+
+ If set when creating a new queue, the queue will be
+ marked as durable. Durable queues remain active when
+ a server restarts. Non-durable queues (transient
+ queues) are purged if/when a server restarts. Note
+ that durable queues do not necessarily hold persistent
+ messages, although it does not make sense to send
+ persistent messages to a transient queue.
+
+ RULE:
+
+ The server MUST recreate the durable queue after a
+ restart.
+
+ RULE:
+
+ The server MUST support both durable and transient
+ queues.
+
+ RULE:
+
+ The server MUST ignore the durable field if the
+ queue already exists.
+
+ exclusive: boolean
+
+ request an exclusive queue
+
+ Exclusive queues may only be consumed from by the
+ current connection. Setting the 'exclusive' flag
+ always implies 'auto-delete'.
+
+ RULE:
+
+ The server MUST support both exclusive (private)
+ and non-exclusive (shared) queues.
+
+ RULE:
+
+ The server MUST raise a channel exception if
+ 'exclusive' is specified and the queue already
+ exists and is owned by a different connection.
+
+ auto_delete: boolean
+
+ auto-delete queue when unused
+
+ If set, the queue is deleted when all consumers have
+ finished using it. Last consumer can be cancelled
+ either explicitly or because its channel is closed. If
+ there was no consumer ever on the queue, it won't be
+ deleted.
+
+ RULE:
+
+ The server SHOULD allow for a reasonable delay
+ between the point when it determines that a queue
+ is not being used (or no longer used), and the
+ point when it deletes the queue. At the least it
+ must allow a client to create a queue and then
+ create a consumer to read from it, with a small
+ but non-zero delay between these two actions. The
+ server should equally allow for clients that may
+ be disconnected prematurely, and wish to re-
+ consume from the same queue without losing
+ messages. We would recommend a configurable
+ timeout, with a suitable default value being one
+ minute.
+
+ RULE:
+
+ The server MUST ignore the auto-delete field if
+ the queue already exists.
+
+ nowait: boolean
+
+ do not send a reply method
+
+ If set, the server will not respond to the method. The
+ client should not wait for a reply method. If the
+ server could not complete the method it will raise a
+ channel or connection exception.
+
+ arguments: table
+
+ arguments for declaration
+
+ A set of arguments for the declaration. The syntax and
+ semantics of these arguments depends on the server
+ implementation. This field is ignored if passive is
+ True.
+
+ ticket: short
+
+ When a client defines a new queue, this belongs to the
+ access realm of the ticket used. All further work
+ done with that queue must be done with an access
+ ticket for the same realm.
+
+ The client provides a valid access ticket giving
+ "active" access to the realm in which the queue exists
+ or will be created, or "passive" access if the if-
+ exists flag is set.
+
+ Returns a tuple containing 3 items:
+ the name of the queue (essential for automatically-named queues)
+ message count
+ consumer count
+
+ """
+ if arguments is None:
+ arguments = {}
+
+ args = AMQPWriter()
+ if ticket is not None:
+ args.write_short(ticket)
+ else:
+ args.write_short(self.default_ticket)
+ args.write_shortstr(queue)
+ args.write_bit(passive)
+ args.write_bit(durable)
+ args.write_bit(exclusive)
+ args.write_bit(auto_delete)
+ args.write_bit(nowait)
+ args.write_table(arguments)
+ self._send_method((50, 10), args)
+
+ if not nowait:
+ return self.wait(allowed_methods=[
+ (50, 11), # Channel.queue_declare_ok
+ ])
+
+
+ def _queue_declare_ok(self, args):
+ """
+ confirms a queue definition
+
+ This method confirms a Declare method and confirms the name of
+ the queue, essential for automatically-named queues.
+
+ PARAMETERS:
+ queue: shortstr
+
+ Reports the name of the queue. If the server generated
+ a queue name, this field contains that name.
+
+ message_count: long
+
+ number of messages in queue
+
+ Reports the number of messages in the queue, which
+ will be zero for newly-created queues.
+
+ consumer_count: long
+
+ number of consumers
+
+ Reports the number of active consumers for the queue.
+ Note that consumers can suspend activity
+ (Channel.Flow) in which case they do not appear in
+ this count.
+
+ """
+ queue = args.read_shortstr()
+ message_count = args.read_long()
+ consumer_count = args.read_long()
+
+ return queue, message_count, consumer_count
+
+
+ def queue_delete(self, queue='', if_unused=False, if_empty=False,
+ nowait=False, ticket=None):
+ """
+ delete a queue
+
+ This method deletes a queue. When a queue is deleted any
+ pending messages are sent to a dead-letter queue if this is
+ defined in the server configuration, and all consumers on the
+ queue are cancelled.
+
+ RULE:
+
+ The server SHOULD use a dead-letter queue to hold messages
+ that were pending on a deleted queue, and MAY provide
+ facilities for a system administrator to move these
+ messages back to an active queue.
+
+ PARAMETERS:
+ queue: shortstr
+
+ Specifies the name of the queue to delete. If the
+ queue name is empty, refers to the current queue for
+ the channel, which is the last declared queue.
+
+ RULE:
+
+ If the client did not previously declare a queue,
+ and the queue name in this method is empty, the
+ server MUST raise a connection exception with
+ reply code 530 (not allowed).
+
+ RULE:
+
+ The queue must exist. Attempting to delete a non-
+ existing queue causes a channel exception.
+
+ if_unused: boolean
+
+ delete only if unused
+
+ If set, the server will only delete the queue if it
+ has no consumers. If the queue has consumers the
+ server does does not delete it but raises a channel
+ exception instead.
+
+ RULE:
+
+ The server MUST respect the if-unused flag when
+ deleting a queue.
+
+ if_empty: boolean
+
+ delete only if empty
+
+ If set, the server will only delete the queue if it
+ has no messages. If the queue is not empty the server
+ raises a channel exception.
+
+ nowait: boolean
+
+ do not send a reply method
+
+ If set, the server will not respond to the method. The
+ client should not wait for a reply method. If the
+ server could not complete the method it will raise a
+ channel or connection exception.
+
+ ticket: short
+
+ The client provides a valid access ticket giving
+ "active" access rights to the queue's access realm.
+
+ """
+ args = AMQPWriter()
+ if ticket is not None:
+ args.write_short(ticket)
+ else:
+ args.write_short(self.default_ticket)
+
+ args.write_shortstr(queue)
+ args.write_bit(if_unused)
+ args.write_bit(if_empty)
+ args.write_bit(nowait)
+ self._send_method((50, 40), args)
+
+ if not nowait:
+ return self.wait(allowed_methods=[
+ (50, 41), # Channel.queue_delete_ok
+ ])
+
+
+ def _queue_delete_ok(self, args):
+ """
+ confirm deletion of a queue
+
+ This method confirms the deletion of a queue.
+
+ PARAMETERS:
+ message_count: long
+
+ number of messages purged
+
+ Reports the number of messages purged.
+
+ """
+ return args.read_long()
+
+
+ def queue_purge(self, queue='', nowait=False, ticket=None):
+ """
+ purge a queue
+
+ This method removes all messages from a queue. It does not
+ cancel consumers. Purged messages are deleted without any
+ formal "undo" mechanism.
+
+ RULE:
+
+ A call to purge MUST result in an empty queue.
+
+ RULE:
+
+ On transacted channels the server MUST not purge messages
+ that have already been sent to a client but not yet
+ acknowledged.
+
+ RULE:
+
+ The server MAY implement a purge queue or log that allows
+ system administrators to recover accidentally-purged
+ messages. The server SHOULD NOT keep purged messages in
+ the same storage spaces as the live messages since the
+ volumes of purged messages may get very large.
+
+ PARAMETERS:
+ queue: shortstr
+
+ Specifies the name of the queue to purge. If the
+ queue name is empty, refers to the current queue for
+ the channel, which is the last declared queue.
+
+ RULE:
+
+ If the client did not previously declare a queue,
+ and the queue name in this method is empty, the
+ server MUST raise a connection exception with
+ reply code 530 (not allowed).
+
+ RULE:
+
+ The queue must exist. Attempting to purge a non-
+ existing queue causes a channel exception.
+
+ nowait: boolean
+
+ do not send a reply method
+
+ If set, the server will not respond to the method. The
+ client should not wait for a reply method. If the
+ server could not complete the method it will raise a
+ channel or connection exception.
+
+ ticket: short
+
+ The access ticket must be for the access realm that
+ holds the queue.
+
+ RULE:
+
+ The client MUST provide a valid access ticket
+ giving "read" access rights to the queue's access
+ realm. Note that purging a queue is equivalent to
+ reading all messages and discarding them.
+
+ if nowait is False, returns a message_count
+
+ """
+ args = AMQPWriter()
+ if ticket is not None:
+ args.write_short(ticket)
+ else:
+ args.write_short(self.default_ticket)
+ args.write_shortstr(queue)
+ args.write_bit(nowait)
+ self._send_method((50, 30), args)
+
+ if not nowait:
+ return self.wait(allowed_methods=[
+ (50, 31), # Channel.queue_purge_ok
+ ])
+
+
+ def _queue_purge_ok(self, args):
+ """
+ confirms a queue purge
+
+ This method confirms the purge of a queue.
+
+ PARAMETERS:
+ message_count: long
+
+ number of messages purged
+
+ Reports the number of messages purged.
+
+ """
+ return args.read_long()
+
+
+ #############
+ #
+ # Basic
+ #
+ #
+ # work with basic content
+ #
+ # The Basic class provides methods that support an industry-
+ # standard messaging model.
+ #
+ # GRAMMAR:
+ #
+ # basic = C:QOS S:QOS-OK
+ # / C:CONSUME S:CONSUME-OK
+ # / C:CANCEL S:CANCEL-OK
+ # / C:PUBLISH content
+ # / S:RETURN content
+ # / S:DELIVER content
+ # / C:GET ( S:GET-OK content / S:GET-EMPTY )
+ # / C:ACK
+ # / C:REJECT
+ #
+ # RULE:
+ #
+ # The server SHOULD respect the persistent property of basic
+ # messages and SHOULD make a best-effort to hold persistent
+ # basic messages on a reliable storage mechanism.
+ #
+ # RULE:
+ #
+ # The server MUST NOT discard a persistent basic message in
+ # case of a queue overflow. The server MAY use the
+ # Channel.Flow method to slow or stop a basic message
+ # publisher when necessary.
+ #
+ # RULE:
+ #
+ # The server MAY overflow non-persistent basic messages to
+ # persistent storage and MAY discard or dead-letter non-
+ # persistent basic messages on a priority basis if the queue
+ # size exceeds some configured limit.
+ #
+ # RULE:
+ #
+ # The server MUST implement at least 2 priority levels for
+ # basic messages, where priorities 0-4 and 5-9 are treated as
+ # two distinct levels. The server MAY implement up to 10
+ # priority levels.
+ #
+ # RULE:
+ #
+ # The server MUST deliver messages of the same priority in
+ # order irrespective of their individual persistence.
+ #
+ # RULE:
+ #
+ # The server MUST support both automatic and explicit
+ # acknowledgements on Basic content.
+ #