Skip to content

Allow services to be created with custom transport#44

Merged
FalkTannhaeuser merged 2 commits into
FalkTannhaeuser:zeepfrom
GeertvanHorrik:pr/async-services
Apr 17, 2019
Merged

Allow services to be created with custom transport#44
FalkTannhaeuser merged 2 commits into
FalkTannhaeuser:zeepfrom
GeertvanHorrik:pr/async-services

Conversation

@GeertvanHorrik

Copy link
Copy Markdown

Fixes #43

This allows any caller to await the services async, e.g.:

loop = asyncio.get_event_loop()
transport = AsyncTransport(loop, cache=None)
devicemgmt = camera.create_devicemgmt_service(transport=transport)
device_time = await devicemgmt.GetSystemDateAndTime()

Comment thread onvif/client.py
portType=portType,
dt_diff=self.dt_diff,
binding_name=binding_name,
transport=self.transport)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.transport gets set in the __init__ method, so you should be able to pass your AsyncTransport when calling ONVIFCamera(transport=my_async_transport) instead of doing this logic and passing down to the other create services.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because the ONVIFCamera does service calls itself and is not async-aware.

@FalkTannhaeuser
FalkTannhaeuser merged commit d549eed into FalkTannhaeuser:zeep Apr 17, 2019
moisesmejiabs pushed a commit to moisesmejiabs/python-onvif-zeep that referenced this pull request Feb 2, 2025
…async-services"

This reverts commit d549eed, reversing
changes made to 33f8051.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support async zeep / allow services transport override

3 participants