Skip to content

Commit 9eaba5b

Browse files
committed
chore(agent): incrementally remove ractor - stage 1
Signed-off-by: Joseph Livesey <[email protected]>
1 parent 1d1e6cc commit 9eaba5b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

crates/tap-agent/src/agent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ use indexer_monitor::{
4343
empty_escrow_accounts_watcher, escrow_accounts_v1, escrow_accounts_v2, indexer_allocations,
4444
DeploymentDetails, SubgraphClient,
4545
};
46-
use ractor::concurrency::JoinHandle;
4746
use sender_account::SenderAccountConfig;
4847
use sender_accounts_manager_task::SenderAccountsManagerTask;
48+
use tokio::task::JoinHandle;
4949

5050
use crate::{
5151
actor_migrate::LifecycleManager,

crates/tap-agent/src/agent/sender_account.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use indexer_query::{
1818
};
1919
use indexer_watcher::watch_pipe;
2020
use prometheus::{register_gauge_vec, register_int_gauge_vec, GaugeVec, IntGaugeVec};
21+
#[cfg(any(test, feature = "test"))]
2122
use ractor::{Actor, ActorProcessingErr, ActorRef, MessagingErr, SupervisionEvent};
2223
use reqwest::Url;
2324
use sqlx::PgPool;
@@ -327,6 +328,7 @@ impl PartialEq for SenderAccountMessage {
327328
#[cfg(any(test, feature = "test"))]
328329
impl Eq for SenderAccountMessage {}
329330

331+
#[cfg(any(test, feature = "test"))]
330332
/// A SenderAccount manages the receipts accounting between the indexer and the sender across
331333
/// multiple allocations.
332334
///
@@ -338,6 +340,7 @@ impl Eq for SenderAccountMessage {}
338340
/// - Requesting the last RAV from the sender's TAP aggregator for all EOL allocations.
339341
pub struct SenderAccount;
340342

343+
#[cfg(any(test, feature = "test"))]
341344
/// Arguments received in startup while spawing [SenderAccount] actor
342345
pub struct SenderAccountArgs {
343346
/// Configuration derived from config.toml
@@ -371,6 +374,7 @@ pub struct SenderAccountArgs {
371374
pub sender_type: SenderType,
372375
}
373376

377+
#[cfg(any(test, feature = "test"))]
374378
/// State used by the actor
375379
///
376380
/// This is a separate instance that makes it easier to have mutable
@@ -845,6 +849,7 @@ impl State {
845849
}
846850
}
847851

852+
#[cfg(any(test, feature = "test"))]
848853
/// Actor implementation for [SenderAccount]
849854
#[async_trait::async_trait]
850855
impl Actor for SenderAccount {

crates/tap-agent/src/agent/sender_account_task.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ impl SenderAccountTask {
306306
}
307307
#[cfg(test)]
308308
SenderAccountMessage::GetSenderFeeTracker(reply) => {
309+
// Note: This is the ractor-based interface for legacy tests
310+
// The reply.send() is compatible since ractor RpcReplyPort has a send method
309311
let _ = reply.send(state.sender_fee_tracker.clone());
310312
}
311313
#[cfg(test)]

0 commit comments

Comments
 (0)