Skip to content

Commit f581ab9

Browse files
authored
Merge pull request #60 from gmr/functional-consumer
4.0: Codec class, consolidated models, BaseConsumer + TransactionConsumer
2 parents 8478c39 + 87439f7 commit f581ab9

48 files changed

Lines changed: 3487 additions & 5690 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codeclimate.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/testing.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,24 @@ jobs:
2727

2828
- name: Install dependencies
2929
run: uv sync --all-groups
30+
env:
31+
UV_CONFIG_FILE: /dev/null
3032

3133
- name: Create build directory
3234
run: mkdir -p build
3335

3436
- name: Lint Check
3537
run: uv run pre-commit run --all-files
38+
env:
39+
UV_CONFIG_FILE: /dev/null
3640

3741
- name: Run tests
3842
run: |
3943
uv run coverage run
4044
uv run coverage report
4145
uv run coverage xml
46+
env:
47+
UV_CONFIG_FILE: /dev/null
4248

4349
- name: Upload Coverage
4450
uses: codecov/codecov-action@v5

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2009-2017, Gavin M. Roy
1+
Copyright (c) 2009-2026, Gavin M. Roy
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification,

README.md

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ each run in an isolated process. It has the ability to collect statistical
1010
data from the consumer processes and report on it.
1111

1212
[![Version](https://img.shields.io/pypi/v/rejected.svg?)](https://pypi.python.org/pypi/rejected)
13-
[![Coverage](https://img.shields.io/codecov/c/github/gmr/rejected.svg?)](https://codecov.io/github/gmr/rejected?branch=main)
1413
[![License](https://img.shields.io/pypi/l/rejected.svg?)](https://github.com/gmr/rejected/blob/main/LICENSE)
1514

1615
## Features
@@ -30,6 +29,7 @@ pip install rejected
3029
For optional features:
3130

3231
```bash
32+
pip install rejected[avro] # Avro support
3333
pip install rejected[html] # HTML message body support
3434
pip install rejected[msgpack] # MessagePack support
3535
```
@@ -49,37 +49,6 @@ LOGGER = logging.getLogger(__name__)
4949

5050
class Test(consumer.Consumer):
5151

52-
def process(self, message):
53-
LOGGER.debug('In Test.process: %s', message.body)
52+
async def process(self) -> None:
53+
LOGGER.debug('In Test.process: %s', self.body)
5454
```
55-
56-
## Async Consumer
57-
58-
To make a consumer async, you can use Tornado's `@gen.coroutine` decorator on the
59-
`Consumer.prepare` and `Consumer.process` methods. Asynchronous consumers allow
60-
you to use async clients like Tornado's `AsyncHTTPClient` to perform parallel
61-
tasks when processing a single message.
62-
63-
```python
64-
import logging
65-
66-
from rejected import consumer
67-
68-
from tornado import gen
69-
from tornado import httpclient
70-
71-
72-
class AsyncExampleConsumer(consumer.Consumer):
73-
74-
@gen.coroutine
75-
def process(self):
76-
LOGGER.debug('Message: %r', self.body)
77-
http_client = httpclient.AsyncHTTPClient()
78-
results = yield [http_client.fetch('http://www.github.com'),
79-
http_client.fetch('http://www.reddit.com')]
80-
LOGGER.info('Length: %r', [len(r.body) for r in results])
81-
```
82-
83-
## Version History
84-
85-
See [HISTORY.md](HISTORY.md) or the [documentation](https://rejected.readthedocs.io).

README.rst

Lines changed: 0 additions & 208 deletions
This file was deleted.

0 commit comments

Comments
 (0)