mirror of
https://github.com/PartialVolume/shredos.x86_64.git
synced 2026-03-14 14:42:12 +00:00
16 lines
300 B
Python
16 lines
300 B
Python
from queue import Queue
|
|
from apscheduler.schedulers.background import BackgroundScheduler
|
|
|
|
queue = Queue()
|
|
|
|
|
|
def work():
|
|
queue.put("Ping!")
|
|
|
|
|
|
scheduler = BackgroundScheduler()
|
|
scheduler.add_job(work, "interval", seconds=1)
|
|
scheduler.start()
|
|
result = queue.get(timeout=3)
|
|
assert result == "Ping!"
|