asyncz 0.8.0__tar.gz → 0.8.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. {asyncz-0.8.0 → asyncz-0.8.2}/PKG-INFO +1 -1
  2. asyncz-0.8.2/asyncz/__init__.py +1 -0
  3. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/_mapping.py +1 -0
  4. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/datastructures.py +6 -5
  5. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/schedulers/base.py +1 -2
  6. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/interval.py +2 -10
  7. asyncz-0.8.0/asyncz/__init__.py +0 -1
  8. {asyncz-0.8.0 → asyncz-0.8.2}/.gitignore +0 -0
  9. {asyncz-0.8.0 → asyncz-0.8.2}/LICENSE +0 -0
  10. {asyncz-0.8.0 → asyncz-0.8.2}/README.md +0 -0
  11. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/contrib/__init__.py +0 -0
  12. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/contrib/esmerald/__init__.py +0 -0
  13. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/contrib/esmerald/decorator.py +0 -0
  14. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/contrib/esmerald/scheduler.py +0 -0
  15. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/enums.py +0 -0
  16. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/events/__init__.py +0 -0
  17. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/events/base.py +0 -0
  18. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/events/constants.py +0 -0
  19. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/exceptions.py +0 -0
  20. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/executors/__init__.py +0 -0
  21. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/executors/asyncio.py +0 -0
  22. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/executors/base.py +0 -0
  23. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/executors/debug.py +0 -0
  24. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/executors/pool.py +0 -0
  25. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/executors/types.py +0 -0
  26. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/py.typed +0 -0
  27. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/schedulers/__init__.py +0 -0
  28. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/schedulers/asyncio.py +0 -0
  29. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/schedulers/datastructures.py +0 -0
  30. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/schedulers/types.py +0 -0
  31. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/schedulers/utils.py +0 -0
  32. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/state.py +0 -0
  33. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/stores/__init__.py +0 -0
  34. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/stores/base.py +0 -0
  35. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/stores/memory.py +0 -0
  36. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/stores/mongo.py +0 -0
  37. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/stores/redis.py +0 -0
  38. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/stores/types.py +0 -0
  39. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/tasks/__init__.py +0 -0
  40. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/tasks/base.py +0 -0
  41. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/tasks/types.py +0 -0
  42. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/__init__.py +0 -0
  43. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/base.py +0 -0
  44. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/combination.py +0 -0
  45. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/cron/__init__.py +0 -0
  46. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/cron/constants.py +0 -0
  47. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/cron/expressions.py +0 -0
  48. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/cron/fields.py +0 -0
  49. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/cron/trigger.py +0 -0
  50. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/cron/types.py +0 -0
  51. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/date.py +0 -0
  52. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/triggers/types.py +0 -0
  53. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/typing.py +0 -0
  54. {asyncz-0.8.0 → asyncz-0.8.2}/asyncz/utils.py +0 -0
  55. {asyncz-0.8.0 → asyncz-0.8.2}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: asyncz
3
- Version: 0.8.0
3
+ Version: 0.8.2
4
4
  Summary: The scheduler that nobody wants but every application needs.
5
5
  Project-URL: Homepage, https://github.com/dymmond/asyncz
6
6
  Project-URL: Documentation, https://asyncz.dymmond.com/
@@ -0,0 +1 @@
1
+ __version__ = "0.8.2"
@@ -18,6 +18,7 @@ class AsynczObjectMapping(BaseModel):
18
18
  def executors(self) -> Dict[str, str]:
19
19
  return {
20
20
  "debug": "asyncz.executors.debug:DebugExecutor",
21
+ "pool": "asyncz.executors.pool:ThreadPoolExecutor",
21
22
  "threadpool": "asyncz.executors.pool:ThreadPoolExecutor",
22
23
  "processpool": "asyncz.executors.pool:ProcessPoolExecutor",
23
24
  "asyncio": "asyncz.executors.asyncio:AsyncIOExecutor",
@@ -1,4 +1,5 @@
1
- from datetime import datetime, timedelta, timezone, tzinfo
1
+ from datetime import datetime, timedelta, tzinfo
2
+ from datetime import timezone as dt_timezone
2
3
  from typing import TYPE_CHECKING, Any, Callable, List, Optional, Union
3
4
 
4
5
  from pydantic import BaseModel, ConfigDict
@@ -28,11 +29,11 @@ class IntervalState(BaseDatastructureState):
28
29
  Handles the state for a IntervalTrigger.
29
30
  """
30
31
 
31
- timezone: Union[timezone, str, tzinfo]
32
+ timezone: Union[dt_timezone, str, tzinfo]
32
33
  start_at: datetime
33
34
  end_at: Optional[datetime] = None
34
- interval: Optional[Union[timezone, timedelta]] = None
35
- jitter: int
35
+ interval: Optional[Union[dt_timezone, timedelta]] = None
36
+ jitter: Optional[int] = None
36
37
 
37
38
 
38
39
  class CombinationState(BaseDatastructureState):
@@ -49,7 +50,7 @@ class CronState(BaseDatastructureState):
49
50
  Handles the state of the CronTrigger.
50
51
  """
51
52
 
52
- timezone: Optional[Union[timezone, str, tzinfo]] = None
53
+ timezone: Optional[Union[dt_timezone, str, tzinfo]] = None
53
54
  start_at: Optional[datetime] = None
54
55
  end_at: Optional[datetime] = None
55
56
  fields: Optional[List[Any]] = None
@@ -414,7 +414,6 @@ class BaseScheduler(BaseStateExtra, ABC):
414
414
  }
415
415
  task_kwargs = {key: value for key, value in task_struct.items() if value is not undefined}
416
416
  task = Task(self, **task_kwargs)
417
-
418
417
  with self.store_lock:
419
418
  if self.state == SchedulerState.STATE_STOPPED:
420
419
  self.pending_tasks.append((task, store, replace_existing))
@@ -667,7 +666,7 @@ class BaseScheduler(BaseStateExtra, ABC):
667
666
 
668
667
  task_defaults = config.get("task_defaults", {})
669
668
  self.task_defaults = TaskDefaultStruct(
670
- mistrigger_grace_time=to_int(task_defaults.get("mistrigger_grace_time")),
669
+ mistrigger_grace_time=to_int(task_defaults.get("mistrigger_grace_time", 1)),
671
670
  coalesce=to_bool(task_defaults.get("coalesce", True)),
672
671
  max_instances=to_int(task_defaults.get("max_instances", 1)),
673
672
  )
@@ -6,13 +6,7 @@ from tzlocal import get_localzone
6
6
 
7
7
  from asyncz.datastructures import IntervalState
8
8
  from asyncz.triggers.base import BaseTrigger
9
- from asyncz.utils import (
10
- datetime_repr,
11
- normalize,
12
- timedelta_seconds,
13
- to_datetime,
14
- to_timezone,
15
- )
9
+ from asyncz.utils import datetime_repr, normalize, timedelta_seconds, to_datetime, to_timezone
16
10
 
17
11
 
18
12
  class IntervalTrigger(BaseTrigger):
@@ -79,9 +73,7 @@ class IntervalTrigger(BaseTrigger):
79
73
  next_trigger_time = self.start_at
80
74
  else:
81
75
  time_difference_seconds = timedelta_seconds(now - self.start_at)
82
- next_interval_number = int(
83
- ceil(time_difference_seconds / self.interval_size)
84
- )
76
+ next_interval_number = int(ceil(time_difference_seconds / self.interval_size))
85
77
  next_trigger_time = self.start_at + self.interval * next_interval_number
86
78
 
87
79
  if self.jitter is not None:
@@ -1 +0,0 @@
1
- __version__ = "0.8.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes