Add Router API
Open
Nobody has claimed this yet.
enhancement
sw: API
- Dominant language
- Lua
- Stars
- 41
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Currently, backplane cycles read all inputs and write to all outputs. The Router API would allow custom mappings between inputs and outputs.
Example (loose concept, not final):
backplane
-- inputs
:addInput('fission', fissionReactor('right'))
:addInput('fusion', fusionReactor('left'))
:addInput('turbine', industrialTurbine('back'))
:addInput('induction', inductionMatrix('bottom'))
:addInput('securemodem', secureModem('top', 'abc123='))
-- routes
:routes(
route.from('fission', 'fusion') -- filter by adapter name
:match('*:status') -- pattern match metric names
:addOutput('status_board', indicatorGrid) -- add route-scoped output
:slow(), -- preferred cycle ring; backplane will update this route less frequently
route.from('*') -- process all adapters
:match('*:production_rate')
:addOutput('line', labelGrid)
route.from('induction')
:only('mekinduction:energy') -- match list of metrics exactly
:middleware(mw.calcDelta():interval('1t')) -- add route-scoped middleware
:fast() -- backplane will update this route more frequently
)
-- global outputs
:addOutput('log', helloWorld)
-- cycle scheduler with defined fast, normal, and slow ring speeds
backplane:cycleEvery('5t', '5s', '1m')
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the backplane cycle behavior described in the issue and the proposed Router API example. Determine how custom input/output mappings, route matching, route-scoped outputs and middleware, and fast, normal, and slow cycle rings should fit together. The issue names no files or tests, so the completion criteria remain conceptual.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100