ssec-jhu / evolver-ng

Next gen eVolver controller for bioreactor project - wip
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Design interface coupling for History #48

Open jamienoss opened 6 months ago

jamienoss commented 6 months ago

The existing interface of having get and set funcs seems complete for what this is.

Possible API additions:

The main question is how this couples with other interfaces, how is it used?

Questions:

jamienoss commented 6 months ago

@amitschang thoughts?

amitschang commented 6 months ago

I don't see a particular reason to change the behavior - at the moment - that the manager (Evolver) holds the history server and puts read values from devices. I see two main uses of history as a consumer:

jamienoss commented 6 months ago

The webUI for plotting, where there is an api endpoint that calls get with some input query

The get functionality can wait to be properly ironed out, unless we start to need it for restarting from old state, but that too can probably be punted down the road.

The controllers body in case they don't want to buffer themselves, they will have access to the box and thus history so can call it similar to calling get on a device.

This part I'm not so convinced of. For better encapsulation and extensibility, I don't think we should hardwire the requirement that a manager be needed to use a device that has code that sets history. The evolver/manager can store the history, however, my question above is how do the devices couple/interface with the history, and do so directly.

so can call it similar to calling get on a device.

I think this is the crux of my point, yep they can, however, we don't necessarily want to require users to have to re-implement a device's interaction with the history, just because they don't want to use the manager. I don't think the evolver/manager should be the device interface with "history" - which, I think, is effectively what you're saying.

So, the more one aspect of the SDK can work in isolation from the rest, the less susceptible it'll be to getting pretzeled.

Let's chat about this a tad today, it would be good to at least get an idea of how we separate history streams etc, as this may require some args to set that would be better thought out now. We may also need to consider something similar to logging.getLogger()?

jamienoss commented 6 months ago

Another good point, though semi-trivial, I think it would be more intuitive and canonical if we use set instead of put.