SHARE
TWEET

Untitled

a guest Jun 20th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @ray.remote
  2. def issue_request(user_id):
  3.     r = requests.post(url , json, headers)
  4.  
  5.  ray.get([issue_request.remote(id_token[user_id], 1) for _ in range(500)])
  6.      
  7. def issue_request(user_id):
  8.     r = requests.post(url , json, headers)
  9.  
  10. jobs = []
  11. for i in range(500):
  12.     process = multiprocessing.Process(target=issue_request,
  13.                                   args=(admin_id))
  14. jobs.append(process)
  15. for j in jobs:
  16.     j.start()
  17.  
  18. # Ensure all of the processes have finished
  19. for j in jobs:
  20.     j.join()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top