beanlab / quest_framework

A Python framework for fault-tolerant workflows
0 stars 0 forks source link

Determining Side Effects of Invocation of .get() on Resources #37

Open kjstanding opened 3 months ago

kjstanding commented 3 months ago

While creating stream_resources() in historian.py, the questions arose of whether a user's call to .get() on a resource should trigger a resource update for stream_resources(). Further, the question of whether a resource.get() should trigger handle_internal_event() at all should be considered.

The rational here is that stream_resources() yields a current screenshot of available workflow resources to the caller (user wanting to see available resources) anytime there is an "update" to the resources. A user purely reading the value of a resource ought not to trigger a resource update, and therefore a yield of a new resource screenshot, when the resources haven't changed at all.

One solution to this problem would be to change the resources in external.py to not trigger handle_internal_event() on a call to get(). This may be a robust and problematic fix. However, the implications should be considered in dealing with this problem.