Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
https://www.contributor-covenant.org/translations.
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Contributing

<b><a href="https://docs.memphis.dev/memphis-new/getting-started/how-to-contribute">Newer version here</a></b>

We would ❤️ it if you contributed to the project and helped make Memphis{dev} even better.<br>
We will make sure that contributing to Memphis{dev} is easy, enjoyable, and educational for anyone and everyone.<br>
All contributions are welcome, including features, issues, documentation, guides, and more.
Expand Down Expand Up @@ -186,4 +188,4 @@ Please note that this project is released with a Contributor Code of Conduct. By

[Code of Conduct](https://github.com/memphisdev/memphis-broker/blob/master/code_of_conduct.md)

Our Code of Conduct means that you are responsible for treating everyone on the project with respect and courtesy.
Our Code of Conduct means that you are responsible for treating everyone on the project with respect and courtesy.
686 changes: 17 additions & 669 deletions LICENSE.txt

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Utilizing NATS core.
## Installation

```sh
$ pip install memphis
$ pip3 install memphis-py
```

## Importing
Expand All @@ -51,11 +51,9 @@ async def main():
host="<memphis-host>",
username="<application-type username>",
connection_token="<broker-token>",
management_port="<management-port>", # defaults to 5555
tcp_port="<tcp-port>", # defaults to 6666
data_port="<data-port>", # defaults to 7766
reconnect=True, # defaults to False
max_reconnect=10, # defaults to 10
port="<port>", # defaults to 6666
reconnect=True, # defaults to True
max_reconnect=3, # defaults to 3
reconnect_interval_ms=1500, # defaults to 1500
timeout_ms=1500 # defaults to 1500
)
Expand Down Expand Up @@ -170,7 +168,7 @@ of whether there are messages in flight for the client.
### Creating a Producer

```python
producer = memphis.producer(station_name="<station-name>", producer_name="<producer-name>")
producer = await memphis.producer(station_name="<station-name>", producer_name="<producer-name>")
```

### Producing a message
Expand All @@ -190,7 +188,7 @@ producer.destroy()
### Creating a Consumer

```python
consumer = memphis.consumer(
consumer = await memphis.consumer(
station_name="<station-name>",
consumer_name="<consumer-name>",
consumer_group="<group-name>", # defaults to the consumer name
Expand Down
2 changes: 1 addition & 1 deletion examples/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def msg_handler(msgs, error):
memphis = Memphis()
await memphis.connect(host="<memphis-host>", username="<application type username>", connection_token="<broker-token>")

consumer = memphis.consumer(
consumer = await memphis.consumer(
station_name="<station-name>", consumer_name="<consumer-name>", consumer_group="")
consumer.consume(msg_handler)
# Keep your main thread alive so the consumer will keep receiving data
Expand Down
2 changes: 1 addition & 1 deletion examples/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ async def main():
memphis = Memphis()
await memphis.connect(host="<memphis-host>", username="<application type username>", connection_token="<broker-token>")

producer = memphis.producer(
producer = await memphis.producer(
station_name="<station-name>", producer_name="<producer-name>")
for i in range(100):
await producer.produce(bytearray('Message #'+str(i)+': Hello world', 'utf-8'))
Expand Down
21 changes: 21 additions & 0 deletions memphis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# Copyright 2021-2022 The Memphis Authors
# Licensed under the MIT License (the "License");
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# This license limiting reselling the software itself "AS IS".

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from memphis.memphis import Memphis
import memphis.retention_types
import memphis.storage_types
30 changes: 0 additions & 30 deletions memphis/http_request.py

This file was deleted.

Loading