-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support on APScheduler to AsyncEngine #966
Comments
It already does in |
May you help me understand why am I stumbling on such error when using |
It's because you're using APScheduler 3.x which does not support async engines. Only the 4.x series (and the |
Cool. It seems the imports below will not work properly, right?!
|
Yes, those are imports for the 3.x series. |
May you help me smoothly transition to 4.x? |
You could just read the documentation on that. |
Note that 4.x is in an alpha stage, and not generally recommended for production, as there are some existing unresolved issues. If you want to try your luck, you should probably use PostgreSQL as it is the best tested storage back-end and event broker (which is a new concept in 4.x). |
I want to refactor this file. Is it hard work based on your experience? https://github.com/brunolnetto/cnpj-api/blob/main/backend/app/scheduler/base.py |
That's very subjective. I only took a cursory look at it but it's not that much code in my opinion. If you're using the async scheduler, you may have to learn some new paradigms (see the examples in |
HI, it is me again. The new library is broad and attends multiple purposes, congratulations! I installed from Pypi, but it comes not the same as on master branch (Example: TaskDefaults is missing somehow). Do you know the reason why? |
Because there is no final release in the 4.x series, and it would be a pretty bad idea for pip to install a pre-release version by default, wouldn't you agree? |
Agreed. I am not that experient, but I learn much on this discussion. Can you see a workaround to this async issue with previous version? Any pre-release which you recommend most? For my use case,, a subset of current functionalities builds the steps:
Based on above steps, should I also verify if task_type is either 'background' or 'asyncio' and run respectively |
I'm not giving out free consultation for your project. But if you find a problem with APScheduler itself, let me know. One thing I'm wondering about though: why do you have two schedulers in the same process? |
Well, a wise decision. The specific use case is: verify if some tables of a database have reached certain row threshold OR rows age is greater than certain threshold. I am not fully aware of how to use the asyncio scheduler, naturally to perform an async task. In my case, the Scheduler seems enough, don't you think? |
You can schedule and run both synchronous and asynchronous tasks with either |
Would you pre-release the master version on pypi pleeease? :) |
@brunolnetto it's possible to use pip (or basically any other Python package management tool) to install directly from a git repository. If you want to use the pre-release version, I suggest you go that route. |
Things to check first
Feature description
I am trying to use an asynchronous engine on SQLAlchemyJobStore. When defining job stores and starting the scheduler, I get following error:
'AsyncEngine' object has no attribute '_run_ddl_visitor'
. When willapscheduler support async engine?Use case
The text was updated successfully, but these errors were encountered: