Skip to content

Conversation

@pkhansen
Copy link
Collaborator

@pkhansen pkhansen commented Dec 8, 2022

The new subcriber is used in the detector class to refactor out detection and framing subscription handling.

  • Added functionality to update framing subscriber to use different framing subscription and handler functions.

@pkhansen
Copy link
Collaborator Author

pkhansen commented Dec 8, 2022

Tests failing while it's referencing a git depedency with npm. Will update and have tests passing before merge whenever the sdk-interfaces with approriate interfaces is released.

@pkhansen pkhansen requested a review from eskilgh December 8, 2022 11:42
Copy link
Contributor

@eskilgh eskilgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

/**
* Class for handling framing subscriptions
*/
export default class MsgBusSubscriber implements IMsgBusSubscriber {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want improved typing we could make this class generic, where the provided type is whatever message is passed to the subscriptionHandler

MsgBusSubscriber<Detections>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand you correctly that means that we will have to reinstantiate the subscriber when switching framing modes? Not necessarily against that though. It also gave me an idea for the interface

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's a good point. Or you could do a discriminated union type and check for whatever is present

@pkhansen pkhansen force-pushed the framing-subscriber branch 2 times, most recently from 73907dd to 0992ea4 Compare December 12, 2022 09:41
@pkhansen pkhansen force-pushed the framing-subscriber branch from dd84d9b to 71582e5 Compare March 30, 2023 07:33
The new subcriber is used in the detector class to refactor out detection and framing subscription handling.

- Added functionality to update framing subscriber to use different framing subscription and handler functions.
@pkhansen pkhansen force-pushed the framing-subscriber branch from 71582e5 to c270708 Compare April 4, 2023 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants