TGStat
TGStat
Type to search
Advanced channel search
  • flag English
    Site language
    flag Russian flag English flag Uzbek
  • Sign In
  • Catalog
    Channels and groups catalog Search for channels
    Add a channel/group
  • Ratings
    Rating of channels Rating of groups Posts rating
    Ratings of brands and people
  • Analytics
  • Search by posts
  • Telegram monitoring
PHP - Laravel uz

1 Mar, 12:51

Open in Telegram Share Report

True Async

Bugun PHPda asinxron kod yozish imkoniyatini beradigan RFC e'lon qilindi.
Unga ko'ra quyidagi kabi kod yozish mumkin bo'ladi:

Async\run(function() {

$fiber = Async\async(function() {
sleep(1);
return "Fiber completed!";
});

// Execution is paused until the fiber completes
$result = Async\await($fiber);

echo $result . "\n";

echo "Done!\n";
});

Bu JavaScriptdagi async/await ga o'xshaydi va Event Loop mexanizmi orqali ishlaydi.

Hozir PHPda asinxron kod yozishda generatorlardan, 8.1 versiyadan boshlab Fiberlardan yoki Swoole, AMPHP, ReactPHP kabi yechimlardan foydalaniladi.

RFC:
https://wiki.php.net/rfc/true_async

#php #rfc #async
@PhpLaravelUz

404 0 5 6 10
Catalog
Channels and groups catalog Channels compilations Search for channels Add a channel/group
Ratings
Rating of Telegram channels Rating of Telegram groups Posts rating Ratings of brands and people
API
API statistics Search API of posts API Callback
Our channels
@TGStat @TGStat_Chat @telepulse @TGStatAPI
Read
Академия TGStat Telegram Research 2019 Telegram Research 2021 Telegram Research 2023
Contacts
Справочный центр Support Email Jobs
Miscellaneous
Terms and conditions Privacy policy Public offer
Our bots
@TGStat_Bot @SearcheeBot @TGAlertsBot @tg_analytics_bot @TGStatChatBot