ltq 0.1.0__tar.gz → 0.1.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ltq
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Add your description here
5
5
  Author: Tom Clesius
6
6
  Author-email: Tom Clesius <tomclesius@gmail.com>
@@ -11,7 +11,7 @@ Provides-Extra: sentry
11
11
  Description-Content-Type: text/markdown
12
12
 
13
13
  <p align="center">
14
- <img src="assets/logo.png" alt="LTQ" width="400">
14
+ <img src="https://raw.githubusercontent.com/tclesius/ltq/refs/heads/main/assets/logo.png" alt="LTQ" width="400">
15
15
  </p>
16
16
 
17
17
  <p align="center">
@@ -30,11 +30,9 @@ uv add ltq
30
30
 
31
31
  ```python
32
32
  import asyncio
33
- import redis.asyncio as redis
34
33
  import ltq
35
34
 
36
- client = redis.from_url("redis://localhost:6379")
37
- worker = ltq.Worker(client=client)
35
+ worker = ltq.Worker(url="redis://localhost:6379")
38
36
 
39
37
  @worker.task()
40
38
  async def send_email(to: str, subject: str, body: str) -> None:
@@ -83,7 +81,7 @@ Add middleware to handle cross-cutting concerns:
83
81
  from ltq.middleware import Retry, RateLimit, Timeout
84
82
 
85
83
  worker = ltq.Worker(
86
- client=client,
84
+ url="redis://localhost:6379",
87
85
  middlewares=[
88
86
  Retry(max_retries=3, min_delay=1.0),
89
87
  RateLimit(requests_per_second=10),
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="assets/logo.png" alt="LTQ" width="400">
2
+ <img src="https://raw.githubusercontent.com/tclesius/ltq/refs/heads/main/assets/logo.png" alt="LTQ" width="400">
3
3
  </p>
4
4
 
5
5
  <p align="center">
@@ -18,11 +18,9 @@ uv add ltq
18
18
 
19
19
  ```python
20
20
  import asyncio
21
- import redis.asyncio as redis
22
21
  import ltq
23
22
 
24
- client = redis.from_url("redis://localhost:6379")
25
- worker = ltq.Worker(client=client)
23
+ worker = ltq.Worker(url="redis://localhost:6379")
26
24
 
27
25
  @worker.task()
28
26
  async def send_email(to: str, subject: str, body: str) -> None:
@@ -71,7 +69,7 @@ Add middleware to handle cross-cutting concerns:
71
69
  from ltq.middleware import Retry, RateLimit, Timeout
72
70
 
73
71
  worker = ltq.Worker(
74
- client=client,
72
+ url="redis://localhost:6379",
75
73
  middlewares=[
76
74
  Retry(max_retries=3, min_delay=1.0),
77
75
  RateLimit(requests_per_second=10),
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ltq"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Tom Clesius", email = "tomclesius@gmail.com" }]
@@ -5,6 +5,8 @@ from functools import partial
5
5
  from pathlib import Path
6
6
  from typing import TYPE_CHECKING, Any, Awaitable, Callable, ParamSpec
7
7
 
8
+ import redis.asyncio as redis
9
+
8
10
  from .errors import RetryMessage
9
11
  from .task import Task
10
12
  from .message import Message
@@ -24,12 +26,12 @@ P = ParamSpec("P")
24
26
  class Worker:
25
27
  def __init__(
26
28
  self,
27
- client: AsyncRedis,
29
+ url: str = "redis://localhost:6379",
28
30
  middlewares: list[Middleware] | None = None,
29
31
  concurrency: int = 250,
30
32
  poll_sleep: float = 0.1,
31
33
  ) -> None:
32
- self.client: AsyncRedis = client
34
+ self.client: AsyncRedis = redis.from_url(url)
33
35
  self.tasks: list[Task] = []
34
36
  self.middlewares: list[Middleware] = middlewares or []
35
37
  self.concurrency: int = concurrency
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes