Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
- There is a `ManualTaskScheduler` with methods to define a single `Task` and `DelayedTask` with duration after which the task will be executed.
- To access this scheduler use `ae_context.scheduler()` method.
- Tasks should be lightweight as possible because it stored in fixed-size object pool.
- To control task lifetime use `TaskSubscription` a RAII object which automatically resets task if subscribers die.
- To control task lifetime use `TaskSubscription` a RAII object which automatically resets task if subscribers die. This guarantees task would not be invoked if subscription dead.
- In rare cases class can guarantee its lifetime, subscription may be omitted.

### Stdexec
Expand Down
2 changes: 1 addition & 1 deletion aether/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ list(APPEND aether_srcs
)

list(APPEND aether_srcs
"ae_actions/get_client_cloud.cpp"
"ae_actions/get_servers.cpp"
"ae_actions/ping.cpp"
"ae_actions/check_access_for_send_message.cpp"
Expand Down Expand Up @@ -208,6 +207,7 @@ list(APPEND aether_srcs

list(APPEND aether_srcs
"connection_manager/client_connection_manager.cpp"
"connection_manager/get_cloud_aether.cpp"
"connection_manager/client_cloud_manager.cpp"
"connection_manager/server_connection_manager.cpp")

Expand Down
65 changes: 0 additions & 65 deletions aether/ae_actions/get_client_cloud.cpp

This file was deleted.

1 change: 0 additions & 1 deletion aether/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
#include "aether/ae_actions/telemetry.h"
#include "aether/ae_actions/get_servers.h"
#include "aether/ae_actions/select_client.h"
#include "aether/ae_actions/get_client_cloud.h"
#include "aether/ae_actions/check_access_for_send_message.h"

#include "aether/modems/imodem_driver.h"
Expand Down
2 changes: 1 addition & 1 deletion aether/cloud_connections/cloud_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void CloudRequestAction::Succeeded() {

void CloudRequestAction::Failed() {
Finish();
success_event_.Emit();
failure_event_.Emit();
}

CloudRequestAction::SuccessEvent::Subscriber
Expand Down
3 changes: 2 additions & 1 deletion aether/cloud_connections/cloud_server_connections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void CloudServerConnections::SubscribeToServerState(

void CloudServerConnections::ReselectServers() {
// reselct servers on next cycle
ae_context_.scheduler().Task([&]() { InitServers(); });
defer_sub_ = ae_context_.scheduler().Task([&]() { InitServers(); });
}

void CloudServerConnections::UnselectServer(
Expand All @@ -168,6 +168,7 @@ void CloudServerConnections::QuarantineTimer(
server_connection.server()->server_id);
static constexpr Duration kQuarantineDuration =
std::chrono::milliseconds{AE_CLOUD_SERVER_QUARANTINE_TIME_MS};
// TODO: add task subscription here
ae_context_.scheduler().DelayedTask(
[this, sc{&server_connection}]() {
AE_TELED_DEBUG("Release from quarantine server {}",
Expand Down
1 change: 1 addition & 0 deletions aether/cloud_connections/cloud_server_connections.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class CloudServerConnections {
ServersUpdate servers_update_event_;

std::map<std::uintptr_t, Subscription> server_state_subs_;
TaskSubscription defer_sub_;
};
} // namespace ae

Expand Down
Loading
Loading