@@ -7,7 +7,8 @@ edition = "2021"
|
||||
crunch-envelope.workspace = true
|
||||
crunch-in-memory = { workspace = true, optional = true }
|
||||
crunch-traits.workspace = true
|
||||
crunch-nats = {workspace = true,optional = true}
|
||||
crunch-nats = { workspace = true, optional = true }
|
||||
crunch-nodata = { workspace = true, optional = true }
|
||||
|
||||
anyhow.workspace = true
|
||||
tracing.workspace = true
|
||||
@@ -22,7 +23,8 @@ futures.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
[features]
|
||||
default = ["in-memory", "traits", "nats"]
|
||||
default = ["in-memory", "traits"]
|
||||
traits = []
|
||||
in-memory = ["dep:crunch-in-memory"]
|
||||
nats = ["dep:crunch-nats"]
|
||||
nats = ["dep:crunch-nats"]
|
||||
nodata = ["dep:crunch-nodata"]
|
||||
|
@@ -89,6 +89,15 @@ mod builder {
|
||||
Ok(self)
|
||||
}
|
||||
|
||||
#[cfg(feature = "nodata")]
|
||||
pub async fn with_nodata_transport(
|
||||
&mut self,
|
||||
host: &str,
|
||||
) -> Result<&mut Self, crunch_traits::errors::TransportError> {
|
||||
self.transport = Some(Transport::nodata(host)?);
|
||||
Ok(self)
|
||||
}
|
||||
|
||||
pub fn with_outbox(&mut self, enabled: bool) -> &mut Self {
|
||||
self.outbox_enabled = enabled;
|
||||
self
|
||||
|
@@ -23,6 +23,13 @@ impl Transport {
|
||||
crunch_nats::NatsTransport::new(options).await?,
|
||||
)))
|
||||
}
|
||||
|
||||
#[cfg(feature = "nodata")]
|
||||
pub fn nodata(host: &str) -> Result<Self, crunch_traits::errors::TransportError> {
|
||||
Ok(Self(std::sync::Arc::new(
|
||||
crunch_nodata::NoDataTransport::new(host),
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DynTransport> for Transport {
|
||||
|
Reference in New Issue
Block a user