Hi Simpy users, I would like to create a custom shared resource that will notify all processes yielding a put request, if they have been put into the queue (something like the below)
resource = simpy.Resource(env, capacity=1)
def user(env, resource):
req = resource.request()
result = yield req | resource.resource_capacity_full
if req in result:
print 'Place received'
else:
print 'Waiting for resource'
in this case resource_capacity_full would be an Event that is triggered as successful once the Resource is at capacity.
Is there a simple way to do this? perhaps make a subclass of resource and then add a method?
Would really appreciate to hear your ideas/comments.
Kind regards,
Camilla