#!/usr/bin/env python
# encoding: utf-8


"""
@version: v1.0.1
@author: cherry
@license: Apache Licence 
@contact: hjb.123@163.com
@site: http://www.phpgao.com
@software: PyCharm
@project: untitled
@file: client.py
@time: 2016-08-29 15:59
"""

# from __future__ import absolute_import
import datetime

from Celery_t.proj.tasks import add2

# result = add2.delay(4, 5)
result = add2.apply_async((4, 5), queue='add2')

# print result.get()
print result.backend
print result.id

old_t = datetime.datetime.now()
print old_t
while not result.ready():
    print "not ready yet"
    # time.sleep(5)

print result.get()
new_t = datetime.datetime.now()
print (new_t - old_t).microseconds
# endregion
#celery-task-meta-f8579c29-b611-482c-8f6b-524d5c38de99
