Aaron Piotrowski
993 posts

Aaron Piotrowski
@_trowski
Computer programmer, photographer, and coffee lover. Maintainer of @asyncphp, a library for writing async code in PHP using promises and coroutines.
Minnesota, USA Katılım Haziran 2011
313 Takip Edilen567 Takipçiler

@goetas_asmir @dunglas @asyncphp @Alli_g83 Don't let the readme frighten you.
$pool = new ContextWorkerPool();
for ($i = 0; $i < 10; $i++) {
$pool->submit(new EchoTask());
}
$pool->shutdown();
EchoTask needs to be defined in another file so it can be autoloaded in the worker, but still simple.
English

github.com/krakjoe/parall… (ext-parallel) is one of the most underrated php features ever!
- Documentation about it is close to zero :(
- Not enabled by default on PHP... :(
what is holding us from being used in every single modern php app? Is it because of PHP ZTS stuff? or what?
English
Aaron Piotrowski retweetledi

Thank you to our newest sponsor github.com/nayleen! We really appreciate every contribution toward our efforts to bring #async #PHP forward.
Consider sponsoring AMPHP if you use it in one of your projects. Thank you to everyone who supports us!
github.com/sponsors/amphp
English
Aaron Piotrowski retweetledi
Aaron Piotrowski retweetledi

Continuing our series of accessory libraries compatible with amphp/http-server v3 and AMPHP v3, we've tagged v2 of amphp/http-server-form-parser. 🎉
This helper library provides a utility to parse url-encoded form requests or stream large files from multipart/form-data requests. This provides functionality similar to $_POST and $_FILES for an #async #PHP HTTP server using AMPHP. 🚀
github.com/amphp/http-ser…

English
Aaron Piotrowski retweetledi

Aaron Piotrowski retweetledi
Aaron Piotrowski retweetledi

On the heels of last weeks release of amphp/http-server v3, we're working to tag stable releases of the "accessory" libraries. 🛠️
First up is amphp/http-server-router using nikic/fast-route to provide routing for your application.
Incoming HTTP requests are directed to various request handlers based on their path. Routes may define parameters constrained using regex. Parameter values are available in request attributes.
github.com/amphp/http-ser…

English
Aaron Piotrowski retweetledi

Announcing a huge milestone for the AMPHP project – the release of amphp/http-server v3.0, compatible with AMPHP v3 and fibers! 🎉
amphp/http-server provides a non-blocking, concurrent HTTP/1.1 and HTTP/2 application server for #PHP
github.com/amphp/http-ser…
The example above is based on hello-world.php found in the examples directory. It demonstrates the basics of wiring up a simple HTTP server replying with "Hello, World!" to each request.

English

@simPod_ @revoltphp Apologies for the long delay in replying. We were busyupdating the docs and just about ready to tag amphp/http-server v3. We've now done that, have a look at github.com/amphp/http-ser…, built on Revolt's event loop and AMPHP (amphp.org, @asyncphp).
English

@revoltphp 👋🏿 I want to setup a simple http server with Revolt.
Should I create reactphp http server and then mix it together with event-loop-adapter-react or is there a better way?
English
Aaron Piotrowski retweetledi

It's incredible how many smooth upgrades have been made possible through my parameter type widening change. I didn't see the potential at the time of writing the RFC, but @nikita_ppv did. Time flies!
PHP-FIG@phpfig
#PSR7 just got 2 new tags! The evolution vote passed, and we got: 1.1 with argument types 2.0 with return types Both require PHP 7.2; more details available in the PSR meta doc, section 7.2, "Type additions": #72-type-additions" target="_blank" rel="nofollow noopener">php-fig.org/psr/psr-7/meta…
English
Aaron Piotrowski retweetledi

Announcing v2.0 of amphp/parallel, compatible with AMPHP v3 and fibers! 🎉
amphp/parallel provides true parallel processing for #PHP using multiple processes or threads, without blocking, no extensions required.
Below is an example with parent and child scripts communicating.


English
Aaron Piotrowski retweetledi
Aaron Piotrowski retweetledi

Announcing v2.0 of amphp/socket compatible with AMPHP v3 and fibers! 🎊
github.com/amphp/socket/r…
This package builds on our stream interfaces to create socket servers and client connections.
The example creates a basic HTTP server, replying with the IP and port of the client.

English
Aaron Piotrowski retweetledi
Aaron Piotrowski retweetledi

Announcing v2.0 of amphp/dns compatible with AMPHP v3 and fibers! 🎉
github.com/amphp/dns/rele…
The DNS package implements basic #async DNS resolution in #PHP.
Use it for resolving domain names to a host or query any DNS record type, such as MX records as in the example below.

English
Aaron Piotrowski retweetledi

Thanks to our new sponsor @DaniilGentili, a maintainer of @psalmphp!
We use Psalm in AMPHP and our own applications to catch bugs and improve code quality. Sponsoring AMPHP or a Psalm maintainer provides more resources to develop!
github.com/sponsors/danog
github.com/sponsors/amphp
English
Aaron Piotrowski retweetledi

Announcing v2.0 of amphp/process compatible with AMPHP v3 and fibers! 🚀
github.com/amphp/process/…
The process package provides #async execution and communication with child processes from #PHP.
This example pings 5 hosts concurrently in 5 separate child processes.

English
Aaron Piotrowski retweetledi

We've tagged v2.0 of amphp/byte-stream, providing a set of stream interfaces and composable implementations compatible with AMPHP v3 and fibers! 🎉
github.com/amphp/byte-str…
The script below reads a gzip stream from stdin, writing the decompressed bytes to stdout.

English
Aaron Piotrowski retweetledi

Announcing amphp/sync v2.0 which provides synchronization tools compatible with AMPHP v3! 🎊
github.com/amphp/sync/rel…
Sync data access across #async coroutines in one process or share data among multiple #PHP processes! Use semaphores, channels, or a parcel as in the example.

English




