Skip to content

anonymous /gist:5101448

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Coupling - mock,stub
class RequestsSchedule
def fetch_all_expired
# fetch and return all expired definitions from MongoDB
# e.g. use MongoClient somehow
end
end
class RequestToQueuePusher
QUEUE_NAME = 'requests'
def enqueue(requests)
each.requests { |r| enqueue_single(r) }
end
private
def enqueue_singe(request)
#locate messages queue
# push request to queue
end
end
class SchedulerJob
def run
expired_requests = RequestSchedule.new.fetch_all_expired
RequestToQueuePusher.new.enqueue(expired_requests)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.