-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: introduce module coordinator #47
Conversation
e23633f
to
65cee36
Compare
b0def83
to
5b019de
Compare
update: (subscriptionUpdate: SubscriptionUpdate<SiteWiseDataStreamQuery>) => void; | ||
}; | ||
iotsitewise: { | ||
subscribeToAssetTree: (query: SiteWiseAssetTreeQuery, callback: SiteWiseAssetTreeCallback) => AssetTreeSubscription; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is going to be refactored again. But the intention is not to require a Query to get a Session.
Maybe I should get rid of the "Query" language here and move this over to subscribe/promise methods like the core module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, this is definitely incremental, I'm going to hand off that portion to @boweihan to finish off :-)
import { DescribeAssetModelResponse } from '@aws-sdk/client-iotsitewise'; | ||
import { completeDataStreams } from '../../completeDataStreams'; | ||
|
||
export const subscribeToTimeSeriesData = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my mind, this is the definition of a Query implementation. We will just make this produce a Provider<> in the refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
export * from './iotsitewise/time-series-data/types.d'; | ||
|
||
export type IoTAppKitSession = { | ||
subscribeToTimeSeriesData: ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Gareth has pointed out, we'll be changing this class to only handle registering data modules and metrics. This is good incremental progress towards that!
|
||
if (input.registerDataSources !== false) { | ||
/** Automatically registered data sources */ | ||
dataModule.registerDataSource(createDataSource(siteWiseSdk)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next step, support initializing with multiple data modules that each have their own credential schemes :)
|
||
const { update, unsubscribe } = dataModule.subscribeToDataStreams({ queries, request }, (updatedDataStreams) => { | ||
dataStreams = updatedDataStreams; | ||
emit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data and asset requests are fired and emitted independently here. Would it be a better chart experience to guarantee simultaneous initial data delivery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the end goal is to make it configurable on how this behavior is. consider this PR as part one. There's a couple things missing, that is one of them.
* fix aggregated data parsing * remove unused styles in core * mark deprecated mocks as deprecated within core * move mock data source into testing * refactor the data source into source specific folders * add some tests in asset session
ffb5567
5b019de
to
ffb5567
Compare
…G files (#47) Co-authored-by: Mitchell Lee <[email protected]>
* fix aggregated data parsing * remove unused styles in core * mark deprecated mocks as deprecated within core * move mock data source into testing * refactor the data source into source specific folders * add some tests in asset session
Overview
subscribeToDataStream
tosubscribeToTimeSeriesData
data
mocks.spec.ts
tomocks.ts
as it wasn't actually a test file. later we will move this to the testing sub folderParts contributed by @fpauer
Legal
This project is available under the Apache 2.0 License.