[2014-08-22 12:55:32,369: INFO/MainProcess] Connected to ironmq://**:**@localhost// [2014-08-22 12:55:32,384: INFO/MainProcess] Starting new HTTPS connection (1): mq-aws-us-east-1.iron.io [2014-08-22 12:55:33,232: INFO/MainProcess] Starting new HTTPS connection (1): mq-aws-us-east-1.iron.io [2014-08-22 12:55:34,055: WARNING/MainProcess] celery@a05a1d9d42ee ready.
タスクの実行
別のシェルからPythonインタプリタを起動して、タスクを実行します。
$ cd ~/python_apps $ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license"for more information. >>> from spike_tasks.tasks import mul >>> mul.delay(2,3) <AsyncResult: 17839644-bacb-4b0e-ad32-241151831fd6> >>>
ワーカーの実行確認
workerの標準出力に非同期処理の結果が出力されます。2 * 3 = 6です。
... [2014-08-22 12:57:20,066: INFO/MainProcess] Received task: spike_tasks.tasks.mul[17839644-bacb-4b0e-ad32-241151831fd6] [2014-08-22 12:57:20,076: INFO/Worker-1] Starting new HTTPS connection (1): cache-aws-us-east-1.iron.io [2014-08-22 12:57:20,954: INFO/MainProcess] Task spike_tasks.tasks.mul[17839644-bacb-4b0e-ad32-241151831fd6] succeeded in 0.887078803004s: 6