https://github.com/aidenellis/connectmp
๐ฐ ConnectMP - An easy way to share data between Processes in Python.
https://github.com/aidenellis/connectmp
aidenellis connectmp data data-sharing multiprocessing process sharing
Last synced: 12 months ago
JSON representation
๐ฐ ConnectMP - An easy way to share data between Processes in Python.
- Host: GitHub
- URL: https://github.com/aidenellis/connectmp
- Owner: AidenEllis
- License: mit
- Created: 2021-12-20T16:27:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-24T17:10:44.000Z (about 4 years ago)
- Last Synced: 2025-01-27T12:49:50.060Z (about 1 year ago)
- Topics: aidenellis, connectmp, data, data-sharing, multiprocessing, process, sharing
- Language: Python
- Homepage:
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
ConnectMP - Taking Multi-Process Data Sharing to the moon ๐
Contribute
ยท
Community
ยท
Documentation
---
## ๐ซ Introduction :
๐ค `ConnectMP` is an simple, easy way to share data between `Processes` using DB. It's superfast, can handle big datas, can
create `multiple` data connection and really `simple` to get started. ๐ฐ
๐ฅ `ConnectMP` is created out of pure `Frustration` of not being able to find a good solution to comminucate between Processes ๐ฅจ
### ๐ฅ Installation :
`via pip (recommended) :`
```commandline
pip install connectmp
```
## ๐ง Quickstart : (Docs)
### ๐ฅจ connectmp.Connection
Let's see how to create a connection Object.
First, import this:
```python
from connectmp import Connection
```
You can create your own `Connection` with this. Let me show you how:
```python
from connectmp import Connection
connection = Connection()
```
that's it! ๐ You can also create multiple `Connection` like this!
pass it as an argument and use it anywhere you want ๐ฅ
Here's an example below:
#### ๐ฎ Example:
```python
import time
from connectmp import Process, Connection
def do_something(connection):
connection.data = "Sending Some Data."
def track_data(connection):
time.sleep(1)
print(f"Track i: {connection.data}")
if __name__ == '__main__':
conn = Connection() # Creating connection
p1 = Process(target=do_something, args=(conn,))
p2 = Process(target=track_data, args=(conn,))
p1.start()
p2.start()
```
Here we created a `Connection` object named `conn`, and we created 2 `Process`. Both of then share the same `Connection` object so they can communicate with each other. In our
`do_something` function we send the data and in `track-data` function we get the data and print it out.
That's all you needed to know about `ConnectMP`. Hope this helped you ๐
[๐ Back to Top](#)
