Skip to content

A concurrent tool for human. 用concurrent.future实现的易用的并发框架

License

Notifications You must be signed in to change notification settings

huangk10/Scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scheduler

用concurrent.future实现的易用的并发框架

Dependency

python 3.x

How to install

$ git clone https://github.com/huangk10/Scheduler
$ cd Scheduler
$ python setup.py build
$ python setup.py install

Easy to use

from scheduler import Scheduler

with Scheduler() as scheduler:
    scheduler.register(process_one, process_one_args)
    scheduler.register(process_two, process_two_args)
    scheduler.register([process_three, process_four], process_args)
    scheduler.parallel()

How to customize

# 多线程
with Scheduler(kind='thread', max_workers=4) as scheduler:
    ...

# 多进程
with Scheduler(kind='process', max_workers=4) as scheduler:
    ...

# 一般过程
scheduler.register(normal_process, normal_process_args)

# 有前置的过程
scheduler.register([first_process, second_process, ...], processes_common_args)

# 并发执行
scheduler.parallel()

# 顺序执行
scheduler.serilize()

# 结果获取
result = scheduler.results()

About

A concurrent tool for human. 用concurrent.future实现的易用的并发框架

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages