Skip to content

liexusong/ptask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

ptask

ptask is a coroutine for php extension

How to install?

$ git clone https://github.com/liexusong/ptask
$ cd ptask/libtask
$ make
$ sudo make install
$ cd ../ext
$ phpize
$ ./configure --with-php-config=path-to-php-config
$ make
$ sudo make install

modified php.ini add configure entry: extension=ptask.so

How to use?

<?php

function handler($arg)
{
	for ($i = 0; $i < 1000; $i++) {
		echo $arg, ": ", $i, "\n";
		ptask_yield();
	}
}


ptask_create("handler", "handler1");
ptask_create("handler", "handler2");

ptask_run();

About

libtask extension for php

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published