Skip to content

Instantly share code, notes, and snippets.

@jakul
Created October 30, 2014 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakul/a6d31044044967ab8b71 to your computer and use it in GitHub Desktop.
Save jakul/a6d31044044967ab8b71 to your computer and use it in GitHub Desktop.
# A batch function which does the ordering and sends an announcement with (all) the ordered job ids in
# A function receives that announcment and processes the first job from that list
# Each processed job needs to know
# * the number of invites sent for that job today
# * the number of invites sent to each locum today
# While the job doesn't have enough invitations
# While there are locums to try to match
# Sum up the number of sent invites for this locum and hte number of potential invites waiting to be sent and exit if that number is too high
# Try to match the locum to job
# Create entry in mongo if the locum matches
# Increment the number of invites for this job today
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment