示例#1
0
文件: asynpool.py 项目: celery/celery
 def _create_payload(self, type_, args,
                     dumps=_pickle.dumps, pack=pack,
                     protocol=HIGHEST_PROTOCOL):
     body = dumps((type_, args), protocol=protocol)
     size = len(body)
     header = pack('>I', size)
     return header, body, size
示例#2
0
 def _create_payload(self, type_, args,
                     dumps=_pickle.dumps, pack=pack,
                     protocol=HIGHEST_PROTOCOL):
     body = dumps((type_, args), protocol=protocol)
     size = len(body)
     header = pack('>I', size)
     return header, body, size
示例#3
0
文件: asynpool.py 项目: celery/celery
 def send_job(tup):
     # Schedule writing job request for when one of the process
     # inqueues are writable.
     body = dumps(tup, protocol=protocol)
     body_size = len(body)
     header = pack('>I', body_size)
     # index 1,0 is the job ID.
     job = get_job(tup[1][0])
     job._payload = buf_t(header), buf_t(body), body_size
     put_message(job)
示例#4
0
 def send_job(tup):
     # Schedule writing job request for when one of the process
     # inqueues are writable.
     body = dumps(tup, protocol=protocol)
     body_size = len(body)
     header = pack('>I', body_size)
     # index 1,0 is the job ID.
     job = get_job(tup[1][0])
     job._payload = buf_t(header), buf_t(body), body_size
     put_message(job)