Charms.reactive.patterns and updated requests

Hey,

for charm interfaces that follow the request/response pattern there’s a method to create or update a request

For the receiving side new requests are easy to get (via .new_requests() ). However for request updates this does not seem straightforward, short of diffing transmitted data. Is there a common idiom to handle this case?

Thanks,
peter.

Hey Peter,

The request / response pattern in reactive was my attempt to start to formalize some common patterns in interfaces but it never really caught on. As far as I’m aware, there’s only one interface using those classes, which is the one I wrote. FWIW, if you’re working on a new interface, or especially a new charm, it would be better to approach it from the perspective of using the new operator framework, if at all possible.

As for your question, unfortunately no, that implementation doesn’t include any logic for detecting updated requests. Some interface or charm implementations go the route of locally storing a hash of the request data to detect if the request has been updated, but if you’re designing a new interface another approach you could take is to include a nonce in the request data that is changed if the request is updated after it has a response, and the response would include the nonce to which the response applies.