-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use app monitoring instead of polling to establish websocket connection
Fixes #366
- Loading branch information
Showing
14 changed files
with
45 additions
and
41 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 was deleted.
Oops, something went wrong.
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,21 +1,14 @@ | ||
import actionManager from "@managers/action"; | ||
import vatsimManager from "@managers/vatsim"; | ||
import svgManager from "@managers/svg"; | ||
import trackAudioManager from "@managers/trackAudio"; | ||
|
||
export const handleRemoved = (count: number) => { | ||
if (count === 0) { | ||
trackAudioManager.disconnect(); | ||
svgManager.reset(); | ||
} | ||
|
||
// If there are no more ATIS letter actions then stop polling VATSIM. | ||
if (actionManager.getAtisLetterControllers().length === 0) { | ||
vatsimManager.stop(); | ||
} | ||
|
||
// If there are no more actions at all stop trying to connect to TrackAudio | ||
if (actionManager.getActions().length === 0) { | ||
trackAudioManager.disconnect(); | ||
} | ||
}; |
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,10 @@ | ||
import { ApplicationDidLaunchEvent } from "@elgato/streamdeck"; | ||
import trackAudioManager from "@managers/trackAudio"; | ||
import mainLogger from "@utils/logger"; | ||
|
||
const logger = mainLogger.child({ service: "applicationDidLaunch" }); | ||
|
||
export const handleOnApplicationDidLaunch = (ev: ApplicationDidLaunchEvent) => { | ||
logger.info("Received applicationDidLaunch event", ev.application); | ||
trackAudioManager.connect(); | ||
}; |
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,14 @@ | ||
import { ApplicationDidTerminateEvent } from "@elgato/streamdeck"; | ||
import mainLogger from "@utils/logger"; | ||
import trackAudioManager from "@managers/trackAudio"; | ||
import vatsimManager from "@managers/vatsim"; | ||
|
||
const logger = mainLogger.child({ service: "handleOnApplicationDidTerminate" }); | ||
|
||
export const handleOnApplicationDidTerminate = ( | ||
ev: ApplicationDidTerminateEvent | ||
) => { | ||
logger.info("Received applicationDidTerminate event", ev.application); | ||
trackAudioManager.disconnect(); | ||
vatsimManager.stop(); | ||
}; |
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
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
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
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
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