Skip to content

Commit ff853b3

Browse files
author
Christian Barra
authored
Pass params also when subscribe (#223)
* Pass params also when subscribe * Add fragment.
1 parent 6dab874 commit ff853b3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGES/223.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pass params to docker events.

aiodocker/events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ def listen(self):
2020
DeprecationWarning, stacklevel=2)
2121
return self.channel.subscribe()
2222

23-
def subscribe(self, *, create_task=True):
23+
def subscribe(self, *, create_task=True, **params):
2424
"""Subscribes to the Docker events channel. Use the keyword argument
2525
create_task=False to prevent automatically spawning the background
2626
tasks that listen to the events.
2727
2828
This function returns a ChannelSubscriber object.
2929
"""
3030
if create_task and not self.task:
31-
self.task = asyncio.ensure_future(self.run())
31+
self.task = asyncio.ensure_future(self.run(**params))
3232
return self.channel.subscribe()
3333

3434
def _transform_event(self, data):

0 commit comments

Comments
 (0)