Skip to content
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

Multiple sessions 2 #44

Merged
merged 23 commits into from
Aug 27, 2024
Merged

Multiple sessions 2 #44

merged 23 commits into from
Aug 27, 2024

Conversation

lcarlaw
Copy link
Collaborator

@lcarlaw lcarlaw commented Aug 27, 2024

PR with some design changes to allow concurrent sessions. Each session (which presently is each tab) is tagged with an id defined as the initial epoch millisecond. As long as a user keeps a tab open, it will reference the same id, but each new tab will initialize a new app instance.

Application is initialized from the config file, and then the layout is built out in generate_layout in app.py. Global RadarSimulator object variables moved into two dictionaries (sim_times and radar_info) which are stored in dcc.Store objects which are stateless and preserve session independence. Some code configuration changes needed to reference the dcc.Store data as this can only be done through callbacks. Output paths are passed directly to all scripts (Nexrad, munger, hodo, nse, etc.).

Simulation data and output/placefiles are stored in data/SESSION_ID and assets/SESSION_ID. Two logfiles in data/logs monitor all sessions concurrently.

This PR fixes #41. A browser-dependent bug in the handling of the dcc.Store object which holds the radar_info dictionary was uncovered when accessing the app in Firefox: #43.

lcarlaw added 23 commits August 23, 2024 14:12
… for concurrent sessions. Downloads into session-specific folders works, as does script monitoring and cancelling. Radar download status needs to be addressed, and all variables within RadarServer object need to be moved to dcc.Store in a dict.
…c.Store. Radar download and mungering dealt with. Monitoring broken for now.
…tep now. Munger and hodograph monitors inactive right now.
…t application. Getting simulation/clock controls working again, but not quite there...issues with passing updated clock info/datetimes in manage_clock_ function.
…ed_dropdown nor change_time dropdowns update anything, but the rest of the logic seems to be working.
…e launch simulation button clicked, otherwise an error is thrown since one of the dicts hasn't been defined yet. Address playback speed or time selection dropdown restarting a paused simulation
…f radar selections occasionally briefly showing as valid and then reverting.
…icable behavior when selecting radar sites (some would disappear immediately, others wouldn't even register). Set initial dynamic container which sets up app layout to only execute once with a new dcc.Interval. Only turn on monitor function when download and processing scripts are running.
…p to dynamically generate links based on session id.
…spose to a site. If they switched to 2 or 3 radars, the previous "shifted" radar would still be applied. 2) status updates wouldn't complete on hodos as scripts ended before a final pass of monitor() could be made. 3) configs dict from dcc.Store could be None on initial page load.
@tjturnage tjturnage merged commit 8e96484 into tjturnage:main Aug 27, 2024
@lcarlaw lcarlaw deleted the multiple-sessions-2 branch September 27, 2024 17:09
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.

Running and cancelling scripts will not work with multiple concurrent users
2 participants