Skip to content

Commit

Permalink
fix: rebase and more robust runner->run
Browse files Browse the repository at this point in the history
  • Loading branch information
ABeltramo committed Oct 7, 2024
1 parent 8198fe0 commit d914a8b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/moonlight-server/events/events.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct Runner {

virtual void run(std::size_t session_id,
std::string_view app_state_folder,
const std::shared_ptr<events::devices_atom_queue> &plugged_devices_queue,
std::shared_ptr<events::devices_atom_queue> plugged_devices_queue,
const immer::array<std::string> &virtual_inputs,
const immer::array<std::pair<std::string, std::string>> &paths,
const immer::map<std::string, std::string> &env_variables,
Expand Down
2 changes: 1 addition & 1 deletion src/moonlight-server/runners/child_session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RunChildSession : public events::Runner {

void run(std::size_t session_id,
std::string_view app_state_folder,
const std::shared_ptr<events::devices_atom_queue> &plugged_devices_queue,
std::shared_ptr<events::devices_atom_queue> plugged_devices_queue,
const immer::array<std::string> &virtual_inputs,
const immer::array<std::pair<std::string, std::string>> &paths,
const immer::map<std::string, std::string> &env_variables,
Expand Down
2 changes: 1 addition & 1 deletion src/moonlight-server/runners/docker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void create_udev_hw_files(std::filesystem::path base_hw_db_path,

void RunDocker::run(std::size_t session_id,
std::string_view app_state_folder,
const std::shared_ptr<events::devices_atom_queue> &plugged_devices_queue,
std::shared_ptr<events::devices_atom_queue> plugged_devices_queue,
const immer::array<std::string> &virtual_inputs,
const immer::array<std::pair<std::string, std::string>> &paths,
const immer::map<std::string, std::string> &env_variables,
Expand Down
2 changes: 1 addition & 1 deletion src/moonlight-server/runners/docker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class RunDocker : public events::Runner {

void run(std::size_t session_id,
std::string_view app_state_folder,
const std::shared_ptr<events::devices_atom_queue> &plugged_devices_queue,
std::shared_ptr<events::devices_atom_queue> plugged_devices_queue,
const immer::array<std::string> &virtual_inputs,
const immer::array<std::pair<std::string, std::string>> &paths,
const immer::map<std::string, std::string> &env_variables,
Expand Down
2 changes: 1 addition & 1 deletion src/moonlight-server/runners/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using namespace wolf::core::events;

void RunProcess::run(std::size_t session_id,
std::string_view app_state_folder,
const std::shared_ptr<events::devices_atom_queue> &plugged_devices_queue,
std::shared_ptr<events::devices_atom_queue> plugged_devices_queue,
const immer::array<std::string> &virtual_inputs,
const immer::array<std::pair<std::string, std::string>> &paths,
const immer::map<std::string, std::string> &env_variables,
Expand Down
2 changes: 1 addition & 1 deletion src/moonlight-server/runners/process.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RunProcess : public events::Runner {

void run(std::size_t session_id,
std::string_view app_state_folder,
const std::shared_ptr<events::devices_atom_queue> &plugged_devices_queue,
std::shared_ptr<events::devices_atom_queue> plugged_devices_queue,
const immer::array<std::string> &virtual_inputs,
const immer::array<std::pair<std::string, std::string>> &paths,
const immer::map<std::string, std::string> &env_variables,
Expand Down
22 changes: 13 additions & 9 deletions src/moonlight-server/wolf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,19 @@ auto setup_sessions_handlers(const immer::box<state::AppState> &app_state,
}

auto devices_q = plugged_devices_queue->load()->find(session->session_id);

/* Finally run the app, this will stop here until over */
run_session->runner->run(session->session_id,
session->app_state_folder,
*devices_q,
all_devices.persistent(),
mounted_paths.persistent(),
full_env.persistent(),
render_node);
if (!devices_q) {
logs::log(logs::warning, "No devices queue found for session {}", session->session_id);
return;
} else {
/* Finally run the app, this will stop here until over */
run_session->runner->run(session->session_id,
session->app_state_folder,
*devices_q,
all_devices.persistent(),
mounted_paths.persistent(),
full_env.persistent(),
render_node);
}

if (run_session->stop_stream_when_over) {
/* App exited, cleanup */
Expand Down

0 comments on commit d914a8b

Please sign in to comment.