Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自荐:异步非阻塞的网络协议解析包 - Magician #1774

Open
yuyenews opened this issue May 20, 2021 · 0 comments
Open

自荐:异步非阻塞的网络协议解析包 - Magician #1774

yuyenews opened this issue May 20, 2021 · 0 comments

Comments

@yuyenews
Copy link

项目描述

Magician 是一个网络协议解析包,支持TCP和UDP,内置http和webSocket解码器,使用简单:

// 监听几个端口,ioEventGroup的第一个参数就写几
EventGroup ioEventGroup = new EventGroup(2, Executors.newCachedThreadPool());
EventGroup workerEventGroup = new EventGroup(10, Executors.newCachedThreadPool());

// 当前EventRunner没任务的时候,允许从其他EventRunner窃取任务
workerEventGroup.setSteal(EventEnum.STEAL.YES);

TCPServer tcpServer = Magician
                         .createTCPServer(ioEventGroup, workerEventGroup)
                         .handler("/", new DemoHandler())

tcpServer.bind(8080);
tcpServer.bind(8088);

生态(配合起来可以轻松的开发Web项目)

Magician-Web
Magician-JDBC
Magician-Transaction
Martian

TFB测试结果(第二轮,持续优化中)

image

官网及仓库地址

项目官网:http://magician-io.com/
github地址:https://github.com/yuyenews/Magician

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants