🍰 ConnectMP - An easy and efficient way to share data between Processes in Python.

Overview

ConnectMP - Taking Multi-Process Data Sharing to the moon 🚀

Contribute · Community · Documentation


🎫 Introduction :

🍤 ConnectMP is the easiest and efficient way to share data between Processes. 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) :

pip install connectmp

🧇 Quickstart : (Docs)

Please read till the end to find what you're looking for!

🍤 connectmp.Process :

from connectmp import Process

This Process class is same as multiprocessing.Process, it's just modified. So, just use connectmp.Process where you would use multiprocessing.Process

import time
from connectmp import Process


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__':
    p1 = Process(target=do_something, connection=True)
    p2 = Process(target=track_data, args=(p1.connection,))

    p1.start()
    p2.start()

Just let me explain what's happening here. we have 2 functions, one is do_something which just sends data and track_data which recieves the data and print's it. You can see in p1 we are not pasing any argument but our function do_something requires a connection argument.

When you enable Process(connection=True) Your target function will recieve a keyword-argument value named connection which's value will contain the Connection object. This Connection object is an individual connection. But You can of course share this connection with other process.

in p2 we shared the connection of our p1 by p1.connection which returns the connection object of p1. In track_data function we just recieve the data from p1.connection. You can send and recieve data from and to each other.

And yeah to send data all you do is assign the data to connection.data and also to get data you have to do it with connection.data

HOLD ON! You might also be looking for something like this down below!

So, if you're wondering if we can create Conenction seperately without creting Process object? 🎉 YES! YES YOU CAN! with:

🥨 connectmp.Connection

from connectmp import Connection

You can create your own Connection with this. Let me show you how:

from connectmp import Connection

connection = Connection()

that's it! 🎉 You can create multiple Connection! To use it just do it like how we did before, pass it as an argument and use it anywhere you want 🥂

NOTE: Make sure Process(connection=True) is not enabled, or it will conflict with your function params. turn Process(connection=True) when you want to create another Connection and get it in the function as an argument('connection').

🌮 Example:

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()

Now each Process can communicate with each other! That's all you need to know about ConnectMP. Hope this helped you 🎉

🌟 Back to Top

You might also like...
Application for easy configuration of swap file and swappiness priority in slackware and others linux distributions.

Swap File Program created with the objective of assisting in the configuration of swap file in Distributions such as Slackware. Required packages: pyt

Stubmaker is an easy-to-use tool for generating python stubs.

Stubmaker is an easy-to-use tool for generating python stubs. Requirements Stubmaker is to be run under Python 3.7.4+ No side effects during

VerSign: Easy Signature Verification in Python

VerSign: Easy Signature Verification in Python versign is a small Python package which can be used to perform verification of offline signatures. It a

A utility that makes it easy to work with Python projects containing lots of packages, of which you only want to develop some.

Mixed development source packages on top of stable constraints using pip mxdev [mɪks dɛv] is a utility that makes it easy to work with Python projects

Shypan, a simple, easy to use, full-featured library written in Python.

Shypan, a simple, easy to use, full-featured library written in Python.

Easy compression and extraction for any compression or archival format.
Easy compression and extraction for any compression or archival format.

Tzar: Tar, Zip, Anything Really Easy compression and extraction for any compression or archival format. Usage/Examples tzar compress large-dir compres

A collection of common regular expressions bundled with an easy to use interface.

CommonRegex Find all times, dates, links, phone numbers, emails, ip addresses, prices, hex colors, and credit card numbers in a string. We did the har

Regression Metrics Calculation Made easy

Regression Metrics Mean Absolute Error Mean Square Error Root Mean Square Error Root Mean Square Logarithmic Error Root Mean Square Logarithmic Error

A library for interacting with Path of Exile game and economy data, and a unique loot filter generation framework.

wraeblast A library for interfacing with Path of Exile game and economy data, and a set of item filters geared towards trade league players. Filter Ge

Releases(v1.1.0)
  • v1.1.0(Dec 24, 2021)

  • v1.0.0(Dec 24, 2021)

  • v0.1.1(Dec 22, 2021)

    🍩 What's new in ConnectMP v0.1.1 :

    • Now defaultly supports multithreaded Connection
    • Fixed some bugs
    • Added support for command 'connectmp'
    • Can change config with command
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Dec 21, 2021)

    🧇 Official First Release Of ConnectMP

    • ConnectMP.Process
    • ConnectMP.Connection

    Share data between Processes.Share big data.Low latency.Ability to create Connection separately.Works in all System

    Source code(tar.gz)
    Source code(zip)
Owner
Aiden Ellis
Kon'nichiwa, you got my blessings 🥳
Aiden Ellis
Python code to divide big numbers

divide-big-num Python code to divide big numbers

VuMinhNgoc 1 Oct 15, 2021
This is a tool to calculate a resulting color of the alpha blending process.

blec: alpha blending calculator This is a tool to calculate a resulting color of the alpha blending process. A gamma correction is enabled and the def

Igor Mikushkin 12 Sep 07, 2022
convert a dict-list object from / to a typed object(class instance with type annotation)

objtyping 带类型定义的对象转换器 由来 Python不是强类型语言,开发人员没有给数据定义类型的习惯。这样虽然灵活,但处理复杂业务逻辑的时候却不够方便——缺乏类型检查可能导致很难发现错误,在IDE里编码时也没

Song Hui 15 Dec 22, 2022
Tool for generating Memory.scan() compatible instruction search patterns

scanpat Tool for generating Frida Memory.scan() compatible instruction search patterns. Powered by r2. Examples $ ./scanpat.py arm.ks:64 'sub sp, sp,

Ole André Vadla Ravnås 13 Sep 19, 2022
Go through a random file in your favourite open source projects!

Random Source Codes Never be bored again! Staring at your screen and just scrolling the great world wide web? Would you rather read through some code

Mridul Seth 1 Nov 03, 2022
Pass arguments by reference—in Python!

byref Pass arguments by reference—in Python! byrefis a decorator that allows Python functions to declare reference parameters, with similar semantics

9 Feb 10, 2022
Deep Difference and search of any Python object/data.

DeepDiff v 5.6.0 DeepDiff Overview DeepDiff: Deep Difference of dictionaries, iterables, strings and other objects. It will recursively look for all t

Sep Dehpour 1.6k Jan 08, 2023
A python module to update the console without flashing.

A python module to update the console without flashing.

Matthias 112 Dec 19, 2022
These scripts look for non-printable unicode characters in all text files in a source tree

find-unicode-control These scripts look for non-printable unicode characters in all text files in a source tree. find_unicode_control.py should work w

Siddhesh Poyarekar 25 Aug 30, 2022
A Python script that transcript Arcaea chart file (.aff file) into AutoJS touchscreen script which automatically plays the Arcaea chart

ArcaeaAutoplay (AutoJS Version) A Python script that transcript Arcaea chart file (.aff file) into AutoJS touchscreen script which automatically plays

7 Dec 03, 2021
Audio Steganography is a technique used to transmit hidden information by modifying an audio signal in an imperceptible manner.

Audio Steganography Audio Steganography is a technique used to transmit hidden information by modifying an audio signal in an imperceptible manner. Ab

Karan Yuvraj Singh 1 Oct 17, 2021
✨ Un bot Twitter totalement fait en Python par moi, et en français.

Twitter Bot ❗ Un bot Twitter totalement fait en Python par moi, et en français. Il faut remplacer auth = tweepy.OAuthHandler(consumer_key, consumer_se

MrGabin 3 Jun 06, 2021
A tool for testing improper put method vulnerability

Putter-CUP A tool for testing improper put method vulnerability Usage :- python3 put.py -f live-subs.txt Result :- The result in txt file "result.txt"

Zahir Tariq 6 Aug 06, 2021
Build capture utility for Linux

CX-BUILD Compilation Database alternative Build Prerequisite the CXBUILD uses linux system call trace utility called strace which was customized. So I

GLaDOS (G? L? Automatic Debug Operation System) 3 Nov 03, 2022
Implicit hierarchical a posteriori error estimates in FEniCSx

FEniCSx Error Estimation (FEniCSx-EE) Description FEniCSx-EE is an open source library showing how various error estimation strategies can be implemen

Jack S. Hale 1 Dec 08, 2021
A utility that makes it easy to work with Python projects containing lots of packages, of which you only want to develop some.

Mixed development source packages on top of stable constraints using pip mxdev [mɪks dɛv] is a utility that makes it easy to work with Python projects

BlueDynamics Alliance 6 Jun 08, 2022
Greenery - tools for parsing and manipulating regular expressions

Greenery - tools for parsing and manipulating regular expressions

qntm 242 Dec 15, 2022
Tools for binary data on cassette

Micro Manchester Tape Storage Tools for storing binary data on cassette Includes: Python script for encoding Arduino sketch for decoding Eagle CAD fil

Zack Nelson 28 Dec 25, 2022
Simple web index to use bloom filter for Pwned Passwords

pwbloom Simple web index to use bloom filter for Pwned Passwords The index.py runs a simple CGI web service checking passwords with a bloom filter for

Hanno Böck 4 Nov 23, 2021
A python module to validate input.

A python module to validate input.

Matthias 6 Sep 13, 2022