fermi-ad / acsys-python

Python module to access the Fermilab Control System
MIT License
8 stars 2 forks source link

Allow arguments to be passed in `acsys.run_client()` #4

Closed rneswold closed 3 years ago

rneswold commented 3 years ago

@kjhazelwood: It would be nice if the run_client function would have an arguments field where the user could pass arguments to the target async method in addition to the newly create connection object.

rneswold commented 3 years ago

@kjhazelwood : Are you looking for **kwargs style? So a main function would look like this:

async main(con, **args):
    # do stuff

and you would invoke it as:

acsys.run_client(main, arg1='first', arg2='second')

Or the *args style?

kjhazelwood commented 3 years ago

I dont think I have a preference, which ever is most convenient to implement.

rneswold commented 3 years ago

Done: d288cfa95602b48f81012105b64fea62d9b021dc

This allows keyword arguments to be passed (they seemed the most flexible.) The next release will contain this feature.