Skip to content

Move PyNetDicom to twisted or another async io framework #527

@chsasank

Description

@chsasank

In #491, @scaramallion discussed removing python threads and using aysnc io/networking framework like twisted. We were looking to use pynetdicom in our project and we arrived at the same conclusion as @scaramallion. We have gone through twisted and it has great support to create protocols like SSH.

I know DICOM is lot more complicated than say, SMTP - All the more reason to not write low level code. We should leverage as much python ecosystem as possible.

Is your feature request related to a problem? Please describe.

Right now, pynetdicom depends a lot on python threads. It has code to handle race conditions, code to do transport at low level etc. Interface to use pynetdicom is lot difficult to use compared to other protocols because of this.

Describe the solution you'd like

There's a lot of code in pynetdicom whose functionality can be offloaded to twisted or some other framework. Doing this improves maintainability, readability and testability of the repo.

Describe alternatives you've considered

Twisted is great. It has built in support for lot of features required to write very clean code for new protocols. Twisted comes with its own event loop reactor, tcp/ip support allowing us to write proper servers and clients and lot more

These paradigms map fairly well to things like association, SCU, SCP etc.

Another advantage with twisted is we can write this interface called ASGI and then start using proper web frameworks like Django. Django channels has done just this using their channels and daphne projects for websocket protocol.

Additional context

We're willing to do most of the heavy lifting if maintainers can help us with the design that is acceptable to them.

cc: @yvd

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions