Ejemplo n.º 1
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
Ejemplo n.º 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
Ejemplo n.º 3
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)
Ejemplo n.º 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)