Preface Getty is a NIO framework I wrote to learn Java NIO. During the implementation process, I referred to the design of Netty and used Groovy to implement it. Although it is just a toy, the sparrow is small and has all the internal organs. During the implementation process, I not only became familiar with the use of NIO, but also learned a lot of Netty's design ideas, improving my coding and design capabilities. As for why I use Groovy to write it, it’s because I just learned Groovy and I just used it to practice. In addition, Groovy is compatible with Java, so the difference is only in syntax. The underlying implementation is still based on Java API. The core code of Getty does not exceed 500 lines. On the one hand, it benefits from Groovy's concise syntax, and on the other hand, because I only implemented the core logic. The most complicated part is actually the decoder implementation. Scaffolding is easy to build, but building a skyscraper is not that easy, but it is enough for learning NIO. Threading model Getty uses Reactor. The multi-threading model has a dedicated NIO thread - the Acceptor thread is used to listen to the server,
1. Getty-detailed explanation of Java NIO framework design
Introduction: Getty is a NIO framework I wrote to learn Java NIO. Netty was referenced during the implementation process. The design is implemented using Groovy. Although it is just a toy, the sparrow is small and has all the internal organs. During the implementation process, I not only became familiar with the use of NIO, but also learned a lot of Netty's design ideas, improving my coding and design capabilities. As for why I use Groovy to write it, it’s because I just learned Groovy and I just used it to practice. In addition, Groovy is compatible with Java, so the difference is only in syntax. The underlying actual...
##Introduction: .net code private Type GetType(string className) { // Creates current domain. AppDomain currentDomain = AppDomain.CurrentDomain; // Makes an array for the list of assemblies. Assemb...
3. RegisterClientScriptBlock and The difference between RegisterStartupScript
## Introduction: RegisterClientScriptBlock and RegisterStartupScript both register a script block. ClientScript.RegisterClientScriptBlock(this.GetType(), "script1", "alert(1);", true); ClientScript.RegisterStartupScrip ...
4.
php single quotes double quotes
#Introduction: $b = '110'; $type = gettype( $b); echo '333'."$type\n"; echo '333'.'$type\\'; Output 333string 333$type\ 1. When inputting something in double quotes, it can be judged whether it contains a variable. , if it contains variables, it will be output together. 2. The ones in single quotes are different. It does not judge whether there are variables, and all will be output as strings...
5.
PHP Learning (4) - Data type## Introduction:: This article mainly introduces PHP learning ( 4)——Data types, students who are interested in PHP tutorials can refer to it.
6. Single quotes in php (conversion between int type and string type)
Introduction::This This article mainly introduces single quotes in PHP (conversion between int type and string type). Students who are interested in PHP tutorials can refer to it.
7. php realizes infinite classification, php infinite classification display, php infinite classification drop-down box, php infinite classification letter
Introduction: php, unlimited level: PHP implements unlimited level classification: If you write a system yourself, you will often use column management. If there are many levels of column classification, you need to implement unlimited level classification. The code is as follows: 1. Drop-down menu Use in /* Infinite level classification** Logical recursion acquisition type* hid Upper-level column id* step Lower-level column prefix* tid seleted option id*/function LogicGetTypeList($datatable=lanmu_class,$hid=0,$step=,$ tid=-1)
{static $Ty 8. Variable type Common methods for php to determine variable type Introduction: Variable type: variable Type PHP common method to determine variable type: Now let us understand the specific usage method gettype() gettype will return the following values according to the parameter type "boolean" (from PHP 4) "integer" "double" (if it is float, it will return " "double" instead of "float") "string" "array" "object" "resource" (from PHP 4 onwards) "NULL" (from PHP 4 onwards) "unknown typ Introduction: Torch Light How many layers are there: How many layers does Torchlight have? PHP simple object and array conversion function code PHP multi-layer array and object conversion: Copy the code The code is as follows: function arrayToObject($e){ if( gettype($e)!= 'array' ) return; foreach($e as $k=>$v){ if( gettype($v)=='array' || getType($v)=='object' ) $e[$k ]=(object)arrayToObject($v); } return (objec 10. Variable type PHP judgment variable type implementation code Introduction: Variable type: Variable type PHP judgment variable type implementation code: PHP includes several functions to judge the type of variables, such as: gettype(), is_array(), is_float(), is_int(), is_object( ) and is_string(). Copy the code as follows: [Related Q&A recommendation]:
How to use methods in objects created using factory mode
##linux - If you accidentally delete /sbin/agetty. ... what to do?
java - Is it possible to get the object directly through reflection and realize annotation recycling object
The above is the detailed content of How to use Getty? Summary of Getty instance usage. For more information, please follow other related articles on the PHP Chinese website!