Closed stonier closed 10 years ago
It needs better documentation.
It's a parameter of the RequestSet()
constructor that determines whether it contains ResourceRequest
or ResourceReply
elements. Those, in turn, limit what operations can be done with the requests to specifically requester or scheduler transitions, respectively. The replies
field is intentionally ignored when testing request sets for equality.
The requester module sends request sets with replies=False
and tags received feedback with replies=True
. The scheduler module receives requests with replies=False
and sends feedback with replies=True
. Now I've written that, it appears unnecessarily convoluted. Probably each side of the protocol can exclusively use its own type for both incoming and outgoing messages. That should work and will be easier to explain and understand. I'll look into making that change.
It's all a hack. I am open to suggestions for a cleaner solution. The obvious alternative is making a pair of derived classes based on RequestSet
. So far, I've been reluctant to do it that way.
I'll probably make the change described above. Using the types consistently within the scheduler node and the requester nodes is much better.
With that simplification, defining two different derived classes makes sense. Those classes could be defined in the scheduler and requester modules, so it would always be clear which to use. Then the replies
field would not be needed any more.
That looks like a good solution, but I am open to other ideas.
The replies
field was added when I introduced ResourceRequest
and ResourceReply
as separate classes with different state transition methods. That was a good idea, but the replies
hack was not well thought-out.
The commit above removes the replies
parameter and data member, replacing it with a contents
parameter, which should either be ResourceRequest
(the default) or ResourceReply
(when instantiated within a scheduler).
With that change, I don't think RequestSet
needs any derived classes, but I am thinking of renaming ResourceReply
to something else, maybe ResourceResponse
.
Just caught up on this - it looks good jack.
I'm seeing this below in a request set feedback response: