Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
VennDev authored Aug 28, 2024
1 parent e45275d commit 5d0c81b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ As you can see that I stopped at that very moment to do a wait for a task to com
The Await-Generator has a problem that if I create a promise and just ask it to run without waiting immediately after I declare it, it's like if you have a for loop for billions of numbers, if I wait and run the promise right below it, it will tell me that I'm synchronizing?
I've noticed that there is a queue in the library's Await processing class, however, assuming that if no promises are triggered, the promises that need to be fulfilled are when they are processed? and where is their real-time?
What if I want the promise of processing 1 billion tasks and needing to do it immediately after completing it will fulfill some parameter to do the next thing? Note that this is 1 billion.
```php
$channel = new Channel;
Await::f2c(function() use ($channel) {
for ($i = 0; $i < 5000000; $i++) {
yield from $channel->sendAndWait($i);
}
});
```
The question arises that why do I have to?? wait a long time to handle a big disagreement like this without handling them asynchronously and quickly?

- **Speed test:** [Code](https://gist.github.com/VennDev/4f7be83d55abfbbf44ff2d249e94968c) with according to the inherent method, Await-Generator still wants to wait and process as usual without using the Task-Scheduler.
![image](https://github.com/user-attachments/assets/07a39109-8db4-488d-a0db-6e3404edadf3)

0 comments on commit 5d0c81b

Please sign in to comment.