[package]
name = "hearsay"
version = "0.1.0"
authors = ["Matthew Berger <matthewjordanberger@gmail.com>"]
description = """
A message broker and client for topic-based pub/sub messaging over TCP, built on tokio, with broker bridging, websockets, process spawning, and strongly typed enum contracts.
"""
homepage = "https://github.com/matthewjberger/hearsay"
repository = "https://github.com/matthewjberger/hearsay"
keywords = ["pubsub", "broker", "messaging", "tokio", "ipc"]
categories = ["network-programming", "asynchronous", "wasm"]
license = "MIT OR Apache-2.0"
edition = "2024"
rust-version = "1.95"
exclude = ["demo"]

[package.metadata.docs.rs]
all-features = true

[features]
spawn = ["tokio/process"]
websockets = ["dep:tokio-tungstenite", "dep:futures-util"]

[dependencies]
enum2contract = "0.3"
postcard = { version = "1.0.4", features = ["alloc"] }
serde = { version = "1.0", features = ["derive"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
futures-util = { version = "0.3", default-features = false, features = [
    "sink",
    "std",
], optional = true }
serde_json = "1.0"
socket2 = { version = "0.5", features = ["all"] }
tokio = { version = "1", features = ["io-util", "macros", "net", "rt", "sync", "time"] }
tokio-tungstenite = { version = "0.26", optional = true }
uuid = { version = "1", features = ["v4"] }

[dev-dependencies]
criterion = { version = "0.7", features = ["async_tokio"] }
futures-util = { version = "0.3", default-features = false, features = [
    "sink",
    "std",
] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tokio-tungstenite = "0.26"

[[bench]]
name = "messaging"
harness = false
