Tag:Xiecheng

  • Python performance optimization

    Time:2021-6-24

    background This paper mainly discusses the performance analysis and optimization of Python code, aiming to solve some common performance bottlenecks at the language level. It is the accumulation and summary in the usual work. It will be more basic and comprehensive. By the way, it will also introduce some optimization experience in the service architecture. […]

  • Hyperf releases v2.0.9, an enterprise level PHP micro service cloud native collaboration framework

    Time:2021-6-23

    Update content This week, we added some new features and fixed bugs in some components to continue to improve the stability of hyperf, which was released on2.0.9Users are advised to update this version with the following command. composer update “hyperf/*” -o Direct access to the official websitehyperf.ioOr documenthyperf.wikiView updates newly added #2331 hyperf/nacosAdd authorization interface […]

  • How to expand “unity3d action game development practice”?

    Time:2021-6-23

    2.1.1. Decomposing complex logic by coprocessingCoroutines handle asynchronous tasks: when you encounter some program requirements that need asynchronous processing, you can use coroutines to implement themAdvantages of using coroutine: simple and easy to implementExample: using coroutine instead of finite state machine (based on the code of the original book, some modifications and comments have been […]

  • Using channel to realize communication (message queue) between corollaries in spool

    Time:2021-6-23

    passageway Coroutine\ChannelUsing local memory, memory is isolated between different processes. It can only be carried out in different processes of the same processpushandpopOperation. Co::set([‘hook_flags’=> SWOOLE_HOOK_ALL]); Co\run(function(){ //Set a channel with a capacity of 1 $chan = new Swoole\Coroutine\Channel(1); Swoole\Coroutine::create(function () use ($chan) { for($i = 0; $i < 100000; $i++) { co::sleep(1.0); //Write data to […]

  • Talk about the trend of back end technology in 2018

    Time:2021-6-18

    I’m too busy today. Write less. I’ll add later. Asynchronous mode Go language is becoming more and more popular, and many large Internet companies are turning to go. Dubbo, the well-known service framework in Java circle, also announced the transformation of asynchronous mode. This is a big trend, asynchronous mode has been verified and recognized […]

  • The concurrent call and use example of spool coroutine

    Time:2021-6-17

    Example 1: Using the feature that the channel pop will automatically suspend the current coroutine and wait for the producer to push the data, the concurrent call is realized, and the result set is combined after the coroutine is completed. $serv = new Swoole\Http\Server(“127.0.0.1”, 9503, SWOOLE_BASE); $serv->on(‘request’, function ($req, $resp) { $chan = new Swoole\Coroutine\Channel(2); […]

  • Go efficient concurrency 10 | context: multi thread concurrency control artifact

    Time:2021-6-16

    How to exit Xiecheng After a coroutine starts, in most cases, it needs to wait for the code to finish executing, and then the coroutine will exit by itself. But what if there is a situation in which it is necessary to let Xiecheng exit ahead of time? In the following code, a watchdog is […]

  • Swoft source code interpretation

    Time:2021-6-15

    Official website:https://www.swoft.org/ Source code interpretation:http://naotu.baidu.com/file/8… Outside the nickname,Welcome to starOur development team set a small goal of star 1000 + gathering offline once The Yii / laravel framework in PHP is very “heavy”heavyLet’s not be specificperformanceAt the same time, the framework can solve many problems quickly and expand easily PHP framework, Yii / laravel in, […]

  • On goroutine and channel

    Time:2021-6-15

    +Goroutine looking at a demand *Demand: which of the 1-900000000 statistics are prime numbers? +Analysis ideas: *The traditional method is to use a cycle to judge whether each number is prime or not. The efficiency is very low *Using concurrent or parallel methods, the task of counting prime numbers is assigned to multiple goroutines to […]

  • Hyperf releases v2.1, an enterprise level PHP micro service cloud native collaboration framework

    Time:2021-6-14

    Update content After several months of development and debugging and internal online trial, it was finally released todayV2.1Version, it does not add some cross era features, but it is forV3.0The arrival of the version laid a good foundation. This week, we mainly improved the dependent version of some components, the minimum PHP Version (> = […]

  • The application of spool in swoft

    Time:2021-6-13

    date: 2017-12-14 21:34:51Title: the application of swoole in swoft Swoft website:https://www.swoft.org/ Swoft source code interpretation:http://naotu.baidu.com/file/8… Outside the nickname,Welcome to starOur development team set a small goal of star 1000 + gathering offline once LastBlog – swoft source code interpretationThe response is not bad. Many students recommend adding another article to explain the function of swoole […]

  • Phpmqtt v1.3.0 release, mqtt protocol analysis & coroutine client

    Time:2021-6-12

    In v1.3.0, a new message class cluster is added, which is mainly used to reply to peer ack in the server. use Simps\MQTT\Protocol\Types; use Simps\MQTT\Protocol\V3; use Simps\MQTT\Message\ConnAck; use Simps\MQTT\Message\PingResp; $server = new Swoole\Server(‘127.0.0.1’, 1883, SWOOLE_BASE); $server->set( [ ‘open_mqtt_protocol’ => true, ‘package_max_length’ => 2 * 1024 * 1024, ] ); $server->on(‘connect’, function ($server, $fd) { echo […]