project8 / psyllid

Data acquisition package for the ROACH2 system
Other
0 stars 1 forks source link

Psyllid does not handle set_condition messages #45

Closed nsoblath closed 6 years ago

nsoblath commented 6 years ago

dripline::hub:: __do_handle_set_condition_request() needs to be reimplemented in request_receiver.

laroque commented 6 years ago

proposal: a configuration top-level key in the psyllid config file set_condition_actions which is a mapping of condition ID values onto batch-actions. In the event that a set_condition is received for which there is an entry, create a batch executor (configure the existing one?) and run it on the actions set.

updated with some details from Noah:

batch_executor should have a scarab::concurrent_queue where XDataType is a param_node (each being an action description); the batch_actions array in the psyllid config file gets pushed into the queue when psyllid starts up, there’d be some method which wraps concurrent_queue::push that lets us add an action or a param_array of actions to the queue; and the execute method of batch_executor would have some infinite loop that processes the next action in the queue whenever it isn’t empty.

it would then be a configuration file writing exercise to add support for any set_condition cases psyllid needs to support.

Also

move the current execute() into something named process_queue() which gets called at the same point, and on each pass through the new infinite loop in execute()

Noah:

we can move the batch_executor.join() to after the if( ! make_connection) block that way we won’t get held up waiting for it to quit and it’ll get canceled by this->cancel() request_receiver will need to be given a pointer to batch_executor

Ben:

is it bad that each will have a pointer to the other?

Noah:

we make them weak_ptrs, and we should be good to go

laroque commented 6 years ago

Next update, for myself more than anything....

psyllid config file

The following should be valid in a psyllid config file:

on-startup:
    - some
    - list
    - at
    -startup
batch-commands:
    hard-abort:
        - steps
        - to
        - hard
        - abort
    soft-abort:
        - steps
        - to
        - soft
        - abort
    build-mask:
        - steps
        - to build the mask

Batch_executor

implement the set_condition handler override in request_receiver to properly decode the above param_node and call the corresponding top-level cmd


validation log & docs

should have new feature & testing details should carefully document the newly available commands and syntax

nsoblath commented 6 years ago

Some extensions to Ben's comments:

batch_executor

request_receiver You didn't say it explicitly, so I'll just mention that the RR needs to also hold the map of the integer key values to the commands that should be called.