Skip to content

A set of utilities for the python multiprocessing and threading modules

Notifications You must be signed in to change notification settings

acidicly/combustive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Combustive

A set of utilities for the python modules, threading and multiprocessing.

Example Usage

For a more detailed look at the executors (passing args,kwargs,and more) take a look at the thread_executor or multiprocessing_executor documentation.

Threading

import time
from combustive import thread_executor

@thread_executor() 
def test(): 
    # the code you want to run here

test.start() # Start the thread
time.sleep(10)
test.kill() # Kill it (This will throw an exception in the terminal)

Multiprocessing

import time
from combustive import multiprocessing_executor

@multiprocessing_executor()
def test():
    # the code you want to run here

test.start() # Start the process
time.sleep(10)
test.terminate() # Terminate the process

Background Loop

Check the documentation of the background loop for a more detailed look at it and its arguments.

import time
from combustive import loop,LoopRunner

@loop(seconds=10,runner=LoopRunner.THREADING)
def test():
    # The code you want to run every 10 seconds

test.start() # Start the background loop
time.sleep(10)
test.stop() # Stop it

About

A set of utilities for the python multiprocessing and threading modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages