๐Ÿฐ 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
Know your customer pipeline in apache air flow

KYC_pipline Know your customer pipeline in apache air flow For a successful pipeline run take these steps: Run you Airflow server Admin - connection

saeed 4 Aug 01, 2022
A quick random name generator

Random Profile Generator USAGE & CREDITS Any public or priavte demonstrative usage of this project is strictly prohibited, UNLESS WhineyMonkey10 (http

2 May 05, 2022
This utility synchronises spelling dictionaries from various tools with each other.

This utility synchronises spelling dictionaries from various tools with each other. This way the words that have been trained on MS Office are also correctly checked in vim or Firefox. And vice versa

Patrice Neff 2 Feb 11, 2022
A Randomizer Oracle

Tezos Randomizer Tezod Randomizer "Oracle". It's a smart contract that you can call to get a random number between X and Y (for now). It uses entropy

Asbjorn Enge 19 Sep 13, 2022
Install, run, and update apps without root and only in your home directory

Qube Apps Install, run, and update apps in the private storage of a Qube. Build and install in Qubes Get the code: git clone https://github.com/micahf

Micah Lee 26 Dec 27, 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
A simple example for calling C++ functions in Python by `ctypes`.

ctypes-example A simple example for calling C++ functions in Python by ctypes. Features call C++ function int bar(int* value, char* msg) with argumene

Yusu Pan 3 Nov 23, 2022
A Python class for checking the status of an enabled Minecraft server

mcstatus provides an easy way to query Minecraft servers for any information they can expose. It provides three modes of access (query, status and ping), the differences of which are listed below in

Nathan Adams 1.1k Jan 06, 2023
This utility lets you draw using your laptop's touchpad on Linux.

FingerPaint This utility lets you draw using your laptop's touchpad on Linux. Pressing any key or clicking the touchpad will finish the drawing

Wazzaps 95 Dec 17, 2022
Skywater 130nm Klayout Device Generators PDK

Skywaters 130nm Technology for KLayout Device Generators Mabrains is excited to share with you our Device Generator Library for Skywater 130nm PDK. It

Mabrains 18 Dec 14, 2022
Napari plugin for loading Bitplane Imaris files .ims

napari-imaris-loader Napari plugin for loading Bitplane Imaris files '.ims'. Notes: For this plugin to work "File/Preferences/Experimental/Render Imag

Alan Watson 4 Dec 01, 2022
Keval allows you to call arbitrary Windows kernel-mode functions from user mode, even (and primarily) on another machine.

Keval Keval allows you to call arbitrary Windows kernel-mode functions from user mode, even (and primarily) on another machine. The user mode portion

42 Dec 17, 2022
Use generator for range function

Use the generator for the range function! installation method: pip install yrange How to use: First import yrange in your application. You can then wo

1 Oct 28, 2021
Python script to get some stats on nodes in a Blender material nodetree

Python script to get some stats on nodes in a Blender material nodetree. It counts the nodes, the node types and the max deep level for group nodes.

Alek Mugnozzo 2 Sep 03, 2022
Fraud Multiplication Table Detection in python

Fraud-Multiplication-Table-Detection-in-python In this program, I have detected fraud multiplication table using python without class. Here, I have co

Sachin Vinayak Dabhade 4 Sep 24, 2021
A small python tool to get relevant values from SRI invoices

SriInvoiceProcessing A small python tool to get relevant values from SRI invoices Some useful info to run the tool Login into your SRI account and ret

Wladymir Brborich 2 Jan 07, 2022
This python program will display all SSID usernames and SSID passwords you once connected to your laptop

Windows-Wifi-password-extractor This python program will display all SSID usernames and SSID passwords you once connected to your laptop How to run th

Bhaskar Pal 3 Apr 26, 2022
Set of scripts for some automation during Magic Lantern development

~kitor Magic Lantern scripts A few automation scripts I wrote to automate some things in my ML development efforts. Used only on Debian running over W

Kajetan Krykwiล„ski 1 Jan 03, 2022
Generates a random prnt.sc link and display image.

Generates a random prnt.sc link and display image.

Emirhan 3 Oct 08, 2021
Automatically Generate Rulesets for IIS for Intelligent HTTP/S C2 Redirection

Automatically Generate Rulesets for IIS for Intelligent HTTP/S C2 Redirection This project converts a Cobalt Strike profile to a functional web.config

Jesse 99 Dec 13, 2022