diff --git a/CHANGES/223.feature b/CHANGES/223.feature new file mode 100644 index 00000000..8afedf0b --- /dev/null +++ b/CHANGES/223.feature @@ -0,0 +1 @@ +Pass params to docker events. \ No newline at end of file diff --git a/aiodocker/events.py b/aiodocker/events.py index cfe78583..7e56b3f7 100644 --- a/aiodocker/events.py +++ b/aiodocker/events.py @@ -20,7 +20,7 @@ def listen(self): DeprecationWarning, stacklevel=2) return self.channel.subscribe() - def subscribe(self, *, create_task=True): + def subscribe(self, *, create_task=True, **params): """Subscribes to the Docker events channel. Use the keyword argument create_task=False to prevent automatically spawning the background tasks that listen to the events. @@ -28,7 +28,7 @@ def subscribe(self, *, create_task=True): This function returns a ChannelSubscriber object. """ if create_task and not self.task: - self.task = asyncio.ensure_future(self.run()) + self.task = asyncio.ensure_future(self.run(**params)) return self.channel.subscribe() def _transform_event(self, data):