summaryrefslogtreecommitdiff
path: root/src/apscheduler/schedulers/sync.py
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2021-09-12 16:11:13 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2021-09-13 01:07:44 +0300
commit9568bf2f1297c87ec1b93306b79de925fb2da08e (patch)
tree2969e7951f8883c41f1359ebbc98bcf85a3fdad6 /src/apscheduler/schedulers/sync.py
parent0a6b0f683edee8bf22d85dc655ad61a8285fd312 (diff)
downloadapscheduler-9568bf2f1297c87ec1b93306b79de925fb2da08e.tar.gz
Implemented one-shot event subscriptions
Such subscriptions are delivered the first matching event and then unsubscribed automatically.
Diffstat (limited to 'src/apscheduler/schedulers/sync.py')
-rw-r--r--src/apscheduler/schedulers/sync.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/apscheduler/schedulers/sync.py b/src/apscheduler/schedulers/sync.py
index dd3f37e..221b284 100644
--- a/src/apscheduler/schedulers/sync.py
+++ b/src/apscheduler/schedulers/sync.py
@@ -73,7 +73,7 @@ class Scheduler:
# Start the scheduler and return when it has signalled readiness or raised an exception
start_future: Future[Event] = Future()
- with self._events.subscribe(start_future.set_result):
+ with self._events.subscribe(start_future.set_result, one_shot=True):
run_future = self._executor.submit(self.run)
wait([start_future, run_future], return_when=FIRST_COMPLETED)