Skip to content

Commit

Permalink
Allow partial input topologies
Browse files Browse the repository at this point in the history
Appliances that take more than one input used to break the topology.
This change makes it so the topology will still run.

Issue #149
  • Loading branch information
slifty committed Mar 4, 2022
1 parent da93a72 commit 2156814
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- The static `getInputTypes` and `getOutputTypes` Appliance methods are now provided the relevant settings values, allowing for dynamic types.

### Fixed
- Topologies with Appliances that only have a subset of their input satisfied will no longer break ([Issue #149](https://github.com/tvkitchen/countertop/issues/149)).

## [0.3.0] - 2021-05-13
### Changed
- Update `@tvkitchen/base-classes` to version `2.0.0-alpha.1`.
Expand Down
16 changes: 12 additions & 4 deletions src/classes/CountertopWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,18 @@ class CountertopWorker {
const inputTopics = this.appliance.constructor.getInputTypes(
this.appliance.settings,
).map(
(inputType) => getStreamTopic(
inputType,
this.stream.getTributaryMap().get(inputType),
),
(inputType) => {
const inputStream = this.stream.getTributaryMap().get(inputType)
if (inputStream) {
return getStreamTopic(
inputType,
inputStream,
)
}
return null
},
).filter(
(topic) => topic !== null,
)
const outputTopics = this.appliance.constructor.getOutputTypes(
this.appliance.settings,
Expand Down

0 comments on commit 2156814

Please # to comment.