Replace polling-based sync detection with SSE (Server-Sent Events) from CAN service for instant push notifications on new asset ingests. Add incremental hash queries via ?since=timestamp parameter to avoid transferring full hash lists on every sync cycle. CAN service changes: - Add broadcast channel (SyncEventSender) in AppState for SSE events - Add GET /sync/events SSE endpoint with auth via header or query param - Fire broadcast events on both ingest and sync push - Add db::get_assets_since() for incremental queries - Support ?since= parameter on POST /sync/hashes can-sync agent changes: - Add SSE subscription with auto-reconnect in can_client - Add get_hashes_since() for incremental catch-up - Rewrite live push loop: SSE-driven with 30s fallback poll - Remove poll_interval parameter from live sync functions All 6 stress tests pass (102 assets, 63 MB/s bidirectional). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
59 lines
1.3 KiB
TOML
59 lines
1.3 KiB
TOML
[package]
|
|
name = "can-service"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Containerized Asset Network - a self-healing local storage daemon"
|
|
|
|
[dependencies]
|
|
# Web framework
|
|
axum = { version = "0.8", features = ["multipart"] }
|
|
tokio = { version = "1", features = ["full"] }
|
|
tower-http = { version = "0.6", features = ["cors", "trace"] }
|
|
tokio-util = { version = "0.7", features = ["io"] }
|
|
|
|
# Database
|
|
rusqlite = { version = "0.32", features = ["bundled"] }
|
|
|
|
# Serialization
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
serde_yaml = "0.9"
|
|
|
|
# Hashing
|
|
sha2 = "0.10"
|
|
hex = "0.4"
|
|
|
|
# Image processing
|
|
image = { version = "0.25", default-features = false, features = ["jpeg", "png", "gif", "webp"] }
|
|
|
|
# File system watching
|
|
notify = "7"
|
|
|
|
# MIME type detection
|
|
mime_guess = "2"
|
|
mime = "0.3"
|
|
|
|
# Logging
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
|
|
# Protobuf (sync API)
|
|
prost = "0.13"
|
|
|
|
# Stream utilities (SSE for sync events)
|
|
tokio-stream = { version = "0.1", features = ["sync"] }
|
|
|
|
# Utilities
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
anyhow = "1"
|
|
thiserror = "2"
|
|
|
|
# OS attributes (unix only, windows uses custom ADS)
|
|
[target.'cfg(unix)'.dependencies]
|
|
xattr = "1"
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|
|
reqwest = { version = "0.12", features = ["multipart", "json"] }
|
|
tokio-test = "0.4"
|