Skip to content

Commit

Permalink
feat: add server feature (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 18, 2023
1 parent e3ca90c commit ab09dd7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
13 changes: 8 additions & 5 deletions crates/mev-share-sse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,24 @@ async-sse = "5.1"
reqwest = { version = "0.11", features = ["stream", "json"] }
futures-util = { workspace = true, features = ["io"] }
http-types = { version = "2.12", default-features = false }
hyper = { workspace = true, features = ["stream"] }
tower.workspace = true
tokio-util = { version = "0.7", features = ["compat"] }
tokio-stream = { version = "0.1", features = ["sync"] }
tower = { workspace = true, optional = true }
hyper = { workspace = true, features = ["stream"], optional = true }
tokio-util = { version = "0.7", features = ["compat"], optional = true }
tokio-stream = { version = "0.1", features = ["sync"], optional = true }

## misc
bytes = "1.4"
pin-project-lite = "0.2"
thiserror = "1.0"
http.workspace = true
http = { workspace = true, optional = true }
serde.workspace = true
serde_json.workspace = true
tokio = { workspace = true, features = ["time"] }
tracing.workspace = true

[features]
server = ["hyper", "http", "tokio-stream", "tokio-util", "tower"]

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
1 change: 1 addition & 0 deletions crates/mev-share-sse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
pub mod client;
pub use client::EventClient;

#[cfg(feature = "server")]
pub mod server;

mod types;
Expand Down
2 changes: 1 addition & 1 deletion crates/mev-share/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ MEV-share client in rust

[dependencies]
mev-share-rpc-api.workspace = true
mev-share-sse.workspace = true
mev-share-sse = { workspace = true, features = ["server"] }
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish = false
edition = "2021"

[dependencies]
mev-share-sse = { path = "../crates/mev-share-sse" }
mev-share-sse = { path = "../crates/mev-share-sse", features = ["server"] }
mev-share-rpc-api = { path = "../crates/mev-share-rpc-api", features = [
"client",
"server",
Expand Down

0 comments on commit ab09dd7

Please sign in to comment.