cool hit counter Chef Fresh - A Do-It-Yourself Minimalist Web Framework_Intefrankly

Chef Fresh - A Do-It-Yourself Minimalist Web Framework


In the last lesson we created a do-it-yourself rpc framework, in this lesson we challenge ourselves to a slightly more difficult task, to create a web framework manually.

I don't really want to call it an MVC framework, because I didn't think about how MVC it was going to be when I made this little project, everything was aimed at being easy to use.

First let's see how easy this web framework is to use

Hello World

is a request dispatcher that is used to throw the received HTTP request object to the responding one for processing.

Used to build routes, what it is responsible for is taking URL rules and hooking them up to form a complex mapping table.

To simplify the implementation details, so there is no support for complex URL rules, such as this form of writing parameters inside URLs like this one is not supported.

It is the core object of the web server, and there are 3 key parameters that need to be provided to build the HttpServer in addition to the IP port, which are the number of IO threads, the number of business threads, and the request dispatcher object. IO threads are used to handle kit word reads and writes and are managed internally by Netty. The business thread is dedicated to handling HTTP requests and is managed by the httpkids framework.

A comprehensive example

Stack depth

Non-Java programmers always complain that java's framework is overly complex, and especially love to talk about Java's horrible call stack. For example, the following image is widely circulated.

So here I'm going to shine a light on the httpkids call stack and we'll see how deep it really is

Project Code

https://github.com/pyloque/httpkids

Web Framework based on Netty for Kids of You

https://github.com/pyloque/rpckids

RPC Framework based on Netty for Kids of You

Big Bang (cosmology)

Follow the public number code hole (computing) ", let's talk about this framework together.


Recommended>>
1、Golang Language Print NinetyNine Multiplication Table
2、Detailed tutorial for installing Ubuntu 1604 dual system on Win7 U disk
3、AVFoundation Framework First Exploration IV
4、Jedis with ShardedJedis Designs
5、TMQ is calling you to get your tickets to the China Mobile Internet Test Development Conference

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号