cyberbit / cyberbit/telem

Add Router API

Open
#88 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.