-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ca0859
commit 82abda8
Showing
10 changed files
with
53 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './run-combined-loader'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Combines the data from runfiles stored in buckets with the live data retrieved from the websocket. | ||
*/ | ||
|
||
import { GetRunResult } from '~/server/run/run-get'; | ||
import { createRunFileLoader } from '../parts/run-files-loader'; | ||
import { createMemo } from 'solid-js'; | ||
import { createRunLiveLoader } from '../live/run-live-loader'; | ||
|
||
export function createCombinedRunLoader(runData: () => GetRunResult | undefined) { | ||
const loader = createMemo(() => { | ||
const run = runData(); | ||
if (!run) return null; | ||
return createRunFileLoader(run.files); | ||
}); | ||
|
||
const liveLoader = createRunLiveLoader(); | ||
|
||
return { loader, liveLoader }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './run-files-info'; | ||
export * from './run-files-loader'; | ||
export * from './combined'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { createEffect, onCleanup } from 'solid-js'; | ||
|
||
export function createRunLiveLoader() { | ||
// TODO take url and access token as argument | ||
|
||
createEffect(() => { | ||
const ws = new WebSocket('ws://127.0.0.1:8787/websocket?mode=view&accessKey=abc'); | ||
ws.onopen = () => { | ||
console.log('connected'); | ||
}; | ||
ws.onmessage = (event) => { | ||
console.log('received', event.data); | ||
}; | ||
|
||
onCleanup(() => { | ||
ws.close(); | ||
}); | ||
}); | ||
} |
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
src/lib/viz/loader/run-files-loader.ts → src/lib/viz/loader/parts/run-files-loader.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters