Skip to content

Commit e2b0993

Browse files
committed
feat(trogon-cron): move scheduling to native NATS
1 parent 5a20c1a commit e2b0993

25 files changed

Lines changed: 1839 additions & 20954 deletions

File tree

devops/docker/compose/compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ name: trogonai
22

33
services:
44
nats:
5-
image: nats:2.11-alpine
5+
image: synadia/nats-server:nightly
66
command:
77
- "--jetstream"
88
- "--store_dir=/data"
99
- "--http_port=8222"
10+
ports:
11+
- "127.0.0.1:14222:4222"
12+
- "127.0.0.1:18222:8222"
1013
volumes:
1114
- nats_data:/data
1215
restart: unless-stopped

rsworkspace/Cargo.lock

Lines changed: 19 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rsworkspace/crates/acp-telemetry/src/service_name.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub enum ServiceName {
66
AcpNatsStdio,
77
AcpNatsWs,
88
TrogonCron,
9+
TrogonCronSpawnAdapter,
910
TrogonGateway,
1011
TrogonSourceDiscord,
1112
TrogonSourceGithub,
@@ -21,6 +22,7 @@ impl ServiceName {
2122
Self::AcpNatsStdio => "acp-nats-stdio",
2223
Self::AcpNatsWs => "acp-nats-ws",
2324
Self::TrogonCron => "trogon-cron",
25+
Self::TrogonCronSpawnAdapter => "trogon-cron-spawn-adapter",
2426
Self::TrogonGateway => "trogon-gateway",
2527
Self::TrogonSourceDiscord => "trogon-source-discord",
2628
Self::TrogonSourceGithub => "trogon-source-github",
@@ -47,6 +49,10 @@ mod tests {
4749
assert_eq!(ServiceName::AcpNatsStdio.as_str(), "acp-nats-stdio");
4850
assert_eq!(ServiceName::AcpNatsWs.as_str(), "acp-nats-ws");
4951
assert_eq!(ServiceName::TrogonCron.as_str(), "trogon-cron");
52+
assert_eq!(
53+
ServiceName::TrogonCronSpawnAdapter.as_str(),
54+
"trogon-cron-spawn-adapter"
55+
);
5056
assert_eq!(ServiceName::TrogonGateway.as_str(), "trogon-gateway");
5157
assert_eq!(
5258
ServiceName::TrogonSourceDiscord.as_str(),
@@ -79,6 +85,10 @@ mod tests {
7985
assert_eq!(format!("{}", ServiceName::AcpNatsStdio), "acp-nats-stdio");
8086
assert_eq!(format!("{}", ServiceName::AcpNatsWs), "acp-nats-ws");
8187
assert_eq!(format!("{}", ServiceName::TrogonCron), "trogon-cron");
88+
assert_eq!(
89+
format!("{}", ServiceName::TrogonCronSpawnAdapter),
90+
"trogon-cron-spawn-adapter"
91+
);
8292
assert_eq!(format!("{}", ServiceName::TrogonGateway), "trogon-gateway");
8393
assert_eq!(
8494
format!("{}", ServiceName::TrogonSourceDiscord),
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "trogon-cron-spawn-adapter"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[lints]
7+
workspace = true
8+
9+
[dependencies]
10+
acp-telemetry = { workspace = true }
11+
async-nats = { workspace = true }
12+
clap = { workspace = true, features = ["env"] }
13+
confique = { workspace = true }
14+
futures = { workspace = true }
15+
serde = { workspace = true, features = ["derive"] }
16+
serde_json = { workspace = true }
17+
tokio = { workspace = true, features = ["macros", "process", "rt-multi-thread", "signal", "sync", "time"] }
18+
tracing = { workspace = true }
19+
trogon-nats = { workspace = true }
20+
trogon-service-config = { workspace = true }
21+
trogon-std = { workspace = true, features = ["clap"] }
22+
23+
[dev-dependencies]
24+
tempfile = { workspace = true }
25+
26+
[[bin]]
27+
name = "trogon-cron-spawn-adapter"
28+
path = "src/main.rs"

0 commit comments

Comments
 (0)