dls-controls / pythonSoftIOC

Embed an EPICS IOC in a Python process
Apache License 2.0
32 stars 7 forks source link

Discussion - reccaster like module #89

Closed tynanford closed 7 months ago

tynanford commented 2 years ago

Hi,

We have a few developers looking into using this python IOC framework and it looks really nice. All our IOCs here include IOC stats and reccaster modules and we would like to keep that going. Looking at the docs, I see devIocStats is already available.

Looks like it would be possible to hook reccaster in a similar way or have reccaster be a separate pip package. From the issue below I see there are issues with that approach. We could also write python code to do what reccaster does or even push PVs directly to CF.

https://github.com/dls-controls/pythonSoftIOC/issues/6

Just wondering if anyone is using channel finder/recsync with these IOCs and what the current thoughts are on EPICS module integration.

Thanks!

coretl commented 2 years ago

DLS aren't using channel finder/recsync at the moment, so we haven't come across this problem. How simple is the reccaster protocol? If it's simple then I would probably favour writing it in python, because of the reasons in #6. We're very reluctant to turn pythonSoftIOC into something that loads arbitrary EPICS modules, as that's a slippery slope to becoming an EPICS distribution, but there could be some arguments for including a few widely used modules in one or more separate pip packages...

tynanford commented 2 years ago

It is a fairly simple protocol so I don't think it would be too much of an issue to write it in python. I like that approach too, we can look into doing that at ALS. It would mean maintaining both the EPICS module and the python implementations, but in general reccaster doesn't change often so I think that is okay.

coretl commented 2 years ago

Do you think this should live in another module or in pythonSoftIOC? All code in pythonSoftIOC at the moment works with both cothread and asyncio, which isn't a big deal at the moment as we don't do any socket calls. If we were to add this to pythonSoftIOC then we'd need to make the code support both (cothread uses socket.socket calls, asyncio uses StreamReader and StreamWriter). If it were in another module then you could just support the one you're using...

tynanford commented 2 years ago

Thanks for pointing out the asyncio vs cothread support, that is good to have in mind going forward. For the moment I'd say we can start with reccaster in a separate module and see how that works.

coretl commented 2 years ago

Sounds like a good idea. If you ever need to support multiple sorts of I/O in one module, I recommend the Sans-IO approach. An example I have used it for is PandABlocks-client

tynanford commented 2 years ago

Thanks! We will take a look and keep you updated. Probably won't be able to get to it this week or next

coretl commented 2 years ago

No problem, I'll leave this issue open for a bit. Would you mind putting a github or pypi link to what you're working on when you're ready then close the issue?

tynanford commented 2 years ago

Sure, I'll add the github link here once we get started on it.