{"id":21898993,"url":"https://github.com/ironsdu/joynet","last_synced_at":"2025-03-22T05:25:28.310Z","repository":{"id":144950892,"uuid":"60135924","full_name":"IronsDu/Joynet","owner":"IronsDu","description":"high performance  network (tcp socket) library for lua, based on https://github.com/IronsDu/brynet and lua coroutine.","archived":false,"fork":false,"pushed_at":"2020-06-07T14:37:05.000Z","size":811,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T06:14:52.914Z","etag":null,"topics":["cross-platform","lua","networking","non-blocking","tcp-library"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IronsDu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-01T01:32:23.000Z","updated_at":"2022-03-04T10:10:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"faba6e62-2905-42d1-bb64-9fb811fd7fe2","html_url":"https://github.com/IronsDu/Joynet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronsDu%2FJoynet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronsDu%2FJoynet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronsDu%2FJoynet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronsDu%2FJoynet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IronsDu","download_url":"https://codeload.github.com/IronsDu/Joynet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244911227,"owners_count":20530569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-platform","lua","networking","non-blocking","tcp-library"],"created_at":"2024-11-28T14:36:49.150Z","updated_at":"2025-03-22T05:25:28.292Z","avatar_url":"https://github.com/IronsDu.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Joynet\nWindows : [![Build status](https://ci.appveyor.com/api/projects/status/yyqufbynahl326pe/branch/master?svg=true)](https://ci.appveyor.com/project/IronsDu/joynet/branch/master) Linux : [![Build Status](https://travis-ci.org/IronsDu/Joynet.svg?branch=master)](https://travis-ci.org/IronsDu/Joynet)\n\n\n## 介绍\n\nhigh performance  network library for lua, based on https://github.com/IronsDu/accumulation-dev and `lua coroutine`.\nJoynet 的网络底层使用多线程，但Lua (层面)是运行在单线程上。借助协程提供同步形式的API。\n\n[src](https://github.com/IronsDu/Joynet/tree/master/src) 目录是此项目源代码\n\n[libs](https://github.com/IronsDu/Joynet/tree/master/libs) 目录为基于此Lua协程网络库开发的一些库(譬如`Redis`、`Mysql`、`WebSocket`、`Postgres`、`HTTP Client`)\n\n## 构建\n使用 `git clone`迁出项目并进入项目根目录，并依次使用 `git submodule init`和`git submodule update` 下载依赖项.\n\n然后使用`cmake`和`vcpkg`安装`brynet`进行构建Joynet动态库\n\n## 使用\n[`examples`](https://github.com/IronsDu/Joynet/tree/master/examples) 目录包含测试代码。\n譬如我们要在Windows下运行PingPong测试：\n\n先在项目根目录执行  `lua examples\\PingpongServer.lua`，然后执行 `lua examples\\PingpongClient.lua` 即可\n\n使用此库也很简单,在你的Lua代码里使用`require(\"Joynet\")`加载网络库,然后使用`CoreDD`对象的相关接口即可(具体参考[`examples`](https://github.com/IronsDu/Joynet/tree/master/examples)目录的各示例代码)\n\n当然，你必须先安装有Lua环境\n\n## 关于协程\n协程是轻量级线程，所以多线程有的问题它也有，只是影响程度不同。\n在协程中使用同步API会阻塞当前协程，所以当你的应用程序只有一个协程从外部收取网络消息时，且在消息处理中使用同步API\n操作Redis或者Http的话，效率会很低。 这时有两个方案可解决：1 、再提供回调形式的异步API， 但这样会使开发概念混乱 ；\n2、 在前面说到的情景的消息处理中再开新协程，并在其中操作HTTP/Redis。\n（当然，协程的创建和切换必然有一定开销 ^-^ )\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironsdu%2Fjoynet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fironsdu%2Fjoynet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironsdu%2Fjoynet/lists"}