{"id":20743074,"url":"https://github.com/aimingoo/tundrawolf","last_synced_at":"2026-04-24T14:31:35.988Z","repository":{"id":89039513,"uuid":"45792547","full_name":"aimingoo/tundrawolf","owner":"aimingoo","description":"Parallel Exchangeable Distribution Task for nginx_lua.","archived":false,"fork":false,"pushed_at":"2015-12-03T23:17:43.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-18T02:22:23.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aimingoo.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}},"created_at":"2015-11-08T18:16:43.000Z","updated_at":"2015-11-08T18:18:30.000Z","dependencies_parsed_at":"2023-03-13T18:14:59.884Z","dependency_job_id":null,"html_url":"https://github.com/aimingoo/tundrawolf","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Ftundrawolf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Ftundrawolf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Ftundrawolf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Ftundrawolf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aimingoo","download_url":"https://codeload.github.com/aimingoo/tundrawolf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243034683,"owners_count":20225386,"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":[],"created_at":"2024-11-17T07:08:59.797Z","updated_at":"2026-04-24T14:31:35.958Z","avatar_url":"https://github.com/aimingoo.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tundrawolf\n\ntundrawolf is implement of PEDT - Parallel Exchangeable Distribution Task specifications for nginx_lua.\n\nPEDT v1.1 specifications supported.\n\n### Table of Contents\n\n* [install](#install)\n* [configurations in nginx.conf](#configurations-in-nginxconf)\n* [import and usage](#import-and-usage)\n  * [options](#options)\n  * [interfaces](#interfaces)\n* [helpers](#helpers)\n  * [Tundrawolf.infra.taskhelper](#tundrawolfinfrataskhelper)\n  * [Tundrawolf.infra.httphelper](#tundrawolfinfrahttphelper)\n  * [Tundrawolf.infra.requestdata](#tundrawolfinfrarequestdata)\n  * [tundrawolf.dbg.*](#tundrawolfdbg)\n* [system route discoveries in tundrawolf](#system-route-discoveries-in-tundrawolf)\n* [testcase](#testcase)\n* [history](#history)\n\n# install\n\n\u003e git clone https://github.com/aimingoo/tundrawolf\n\nor\n\n\u003e luarocks install tundrawolf\n\n# configurations in nginx.conf\n\nFirst, append path to nginx.conf:\n\n``` conf\nhttp {\n\tlua_package_path '...;${YOUR_Tundrawolf_DIR}/?.lua;;';\n\t...\n```\n\n\u003e note1: you can skip package_path setting when tundrawolf installed by luarocks\n\u003e \n\u003e note2: @see $(Tundrawolf)/nginx/conf/nginx.conf\n\nAnd next, add proxy_pass_interface in locatoin part:\n\n``` conf\nhttp {\n\t...\n\tserver {\n\t\t...\n\t\tlocation ~ ^/_/cast {\n\t\t\t## for default distributed_request interface in infra.httphelper, copy from:\n\t\t\t## \t$(Tundrawolf)/nginx/conf/nginx.conf\n\t\t}\n```\n\nfor custom distributed_request interface/location, please copy $(tundrawolf)/infra/httphelper.lua to your project, change it and update location in nginx.conf.\n\n# import and usage\n\nLoading Tundrawolf into your source code:\n\n``` lua\n-- require when installed by luarocks\nlocal Tundrawolf = require('tundrawolf');\n\n-- or hard load from lua_path/directory\n-- local Tundrawolf = require('lib.Distributed');\n\nlocal options = {};\nlocal pedt = Tundrawolf:new(options);\n\npedt:run(..)\n\t:andThen(function(result){\n\t\t..\n\t})\n```\n\n## options\n\nthe full options schema:\n\n``` lua\noptions = {\n\tdistributed_request = function(arrResult) .. end, -- a http client implement\n\tsystem_route = { .. }, -- any key/value pairs\n\ttask_register_center = {\n\t\tdownload_task = function(taskId) .. end, -- PEDT interface\n\t\tregister_task = function(taskDef) .. end,  -- PEDT interface\n\t},\n\tresource_status_center = {\n\t\trequire = function(resId) .. end,-- PEDT interface\n\t}\n}\n```\n\n## interfaces\n\n\u003e for detail, @see ${tundrawolf}/infra/specifications/*\n\u003e \n\u003e for Promise in lua, @see [https://github.com/aimingoo/Promise](https://github.com/aimingoo/Promise)\n\nall interfaces are promise supported except pedt.upgrade() and helpers.\n\nall implements is harpseal based, @see [https://github.com/aimingoo/harpseal#interfaces](https://github.com/aimingoo/harpseal#interfaces)\n\n# helpers\n\nsome tool/helpers include in the package.\n\n## Tundrawolf.infra.taskhelper\n\n``` lua\nlocal Tundrawolf = require('tundrawolf');\nlocal def = Tundrawolf.infra.taskhelper;\n-- or\n-- local def = require('tundrawolf.infra.taskhelper');\n\nlocal taskDef = {\n\tx = def:run(...),\n\ty = def:map(...),\n\t...\n}\n```\n\na taskDef define helper.\n\n## Tundrawolf.infra.httphelper\n\n``` lua\nlocal Tundrawolf = require('tundrawolf');\nlocal httphelper = Tundrawolf.infra.httphelper;\n-- or\n-- local httphelper = require('tundrawolf.infra.httphelper');\n\nlocal options = {\n\t...,\n\tdistributed_request = httphelper.distributed_request\n}\n```\n\na recommented/standard distributed request. @see:\n\n\u003e ${tundrawolf}/demo.lua\n\n## Tundrawolf.infra.requestdata\n\n``` lua\nlocal Tundrawolf = require('tundrawolf');\nlocal requestdata = Tundrawolf.infra.requestdata;\n-- or\n-- local requestdata = require('tundrawolf.infra.requestdata');\n\n...\nlocal arguments = requestdata.parse()\nn4c:execute_task(taskId, arguments)\n```\n\nparse arguments of PEDT task from http request. @see\n\n\u003e ${ngx_4c}/module/n4c_executor.lua\n\n## tundrawolf.dbg.*\n\nthese are debug interfaces, please require/load as filemodule, or install by luarocks. @see:\n\n\u003e ${tundrawolf}/demo.lua\n\n# system route discoveries in tundrawolf\n\nin tundrawolf, you can register and discovery any system resources. for examples:\n\n``` lua\n-- got system route discoveries\nlocal Tundrawolf = require('tundrawolf')\nlocal pedt = Tundrawolf:new({})\nlocal system_route_discoveries = pedt:require('n4c.system.discoveries)\n\n-- put your resources\nlocal a_key, my_resource = \"MY:RESOURCE_KEY\", {} -- or anythings except false/nil in nginx_lua\nlocal discoveries = {\n\t[a_key] = function() return my_resource end,\n\t-- more\n}\ntable.foreach(discoveries, function(key, discoverer)\n\tsystem_route_discoveries[key] = discoverer\nend)\n\n-- usage\nlocal res = pedt:require(\"MY:RESOURCE_KEY\") -- a_key\n```\n\nall keys were cached always, so discoverer function call once  until you manual set invalid a_key:\n\n``` lua\npedt.upgrade({system_route = {[a_key] = false}})\n```\n\nfor more example, @see [aimingoo/ngx_4c project](https://github.com/aimingoo/ngx_4c).\n\n# testcase\n\ntry these:\n\n``` bash\n\u003e # goto home directory\n\u003e cd ~\n\u003e git clone 'https://github.com/aimingoo/tundrawolf'\n\n\u003e # goto nginx install direcotry\n\u003e # \tcd {$NGINX_HOME}/sbin\n\u003e ./nginx -p \"${HOME}/tundrawolf/nginx\"\n\n\u003e # goback and launch testcase\n\u003e go ~/tundrawolf/testcase\n\u003e bash test.sh\n```\n\n# history\n\n``` text\n2015.12.03\tv1.0.4 released.\n\t- sync to Harpseal v1.0.4\n2015.11.14\tv1.0.1 released.\n\t- Tundrawolf.infra.requestdata interface published.\n\t- to be compatible ngx_cc at proxy_pass_interface.\n2015.11.09\tv1.0.0 released.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimingoo%2Ftundrawolf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimingoo%2Ftundrawolf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimingoo%2Ftundrawolf/lists"}