Остання активність 1731259318

Asynchronous Programming

mbuffet's Avatar mbuffet ревизій цього gist 1731259316. До ревизії

1 file changed, 15 insertions

gistfile1.txt(файл створено)

@@ -0,0 +1,15 @@
1 + The Basic Anatomy of a Fiber
2 + The beauty of PHP Fibers is in their simplicity. Here’s how to create a fiber and get it up and running:
3 +
4 + $fiber = new Fiber(function() {
5 + echo "Fiber started…\n";
6 + Fiber::suspend(); // Pause the fiber
7 + echo "Fiber resumed…\n";
8 + });
9 + echo "Fiber starting…\n";
10 + $fiber->start(); // Start the fiber
11 + echo "Main script running…\n";
12 + $fiber->resume(); // Resume the fiber
13 +
14 + https://byteblog.medium.com/php-fibers-how-php-is-finally-warming-up-to-asynchronous-programming-39da4d21b8e7
15 + https://itsimiro.medium.com/understanding-fibers-in-php-a-new-way-to-handle-concurrency-ed07424320ff
Новіше Пізніше