Giter VIP home page Giter VIP logo

owl's Issues

报Not Found 错误

Not Found
#0 D:\phpStudy\WWW\owl_test\mysite\vendor\yeaha\owl-mvc\src\Mvc\Router.php(230): Owl\Http\Exception::factory(404)
#1 D:\phpStudy\WWW\owl_test\mysite\vendor\yeaha\owl-mvc\src\Mvc\Router.php(166): Owl\Mvc\Router->respond(Object(Owl\Http\Request), Object(Owl\Http\Response))
#2 D:\phpStudy\WWW\owl_test\mysite\boot.php(59): Owl\Mvc\Router->execute(Object(Owl\Http\Request), Object(Owl\Http\Response))
#3 [internal function]: {closure}(Object(Owl\Http\Request), Object(Owl\Http\Response))
#4 D:\phpStudy\WWW\owl_test\mysite\vendor\yeaha\owl-core\src\Middleware.php(83): call_user_func_array(Object(Closure), Array)
#5 D:\phpStudy\WWW\owl_test\mysite\vendor\yeaha\owl-mvc\src\Application.php(110): Owl\Middleware->execute(Array)
#6 D:\phpStudy\WWW\owl_test\mysite\vendor\yeaha\owl-mvc\src\Application.php(92): Owl\Application->execute(Object(Owl\Http\Request), Object(Owl\Http\Response))
#7 D:\phpStudy\WWW\owl_test\mysite\index.php(7): Owl\Application->start()
#8 {main}

我的报这个错误

关于中间件匿名函数中的 yield true

杨老师您好
最近在学习owl项目,看到在闭包中引用yield true语句,这里似乎理解的不太明白,在以前的学习中一直理解为在使用yield关键字后的语句不会被立即执行,而是放入某个缓冲区,等待下一次在while 或者foreach调用时启用,这时多个代码块会并发执行,来达到协程效果,其在cpu级处于快速切换那什么实现..然后看到这里yield true表示不太理解,您若有时间敬请赐教哦,感激不尽

 * $app->middleware(function($request, $response) {
 *     $start = microtime(true);
 *
 *     yield true;
 *
 *     $use_time = (microtime(true) - $start) * 1000;
 *     $response->withHeader('use-time', (int)$use_time.'ms');
 * });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.