Skip to content

Commit

Permalink
Merge pull request #665 from swimos/docs9
Browse files Browse the repository at this point in the history
Tidy up of crate/module API: Stage 9
  • Loading branch information
horned-sphere authored Jun 26, 2024
2 parents ce1304a + 282efeb commit ad941dd
Show file tree
Hide file tree
Showing 11 changed files with 248 additions and 155 deletions.
2 changes: 1 addition & 1 deletion docs/downlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ the agent at `"/node"` on the host `"swim://example.remote:8080"`. Here `OpenVal
a `HandlerAction` that results in a value of type:

```rust
swimos::agent::agent_model::downlink::hosted::ValueDownlinkHandle
swimos::agent::agent_model::downlink::ValueDownlinkHandle
```

This handle can be used to set the value of the remote lane, through the downlink.
Expand Down
2 changes: 1 addition & 1 deletion example_apps/event_downlink/src/consumer/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use swimos::agent::{
agent_lifecycle::HandlerContext,
agent_model::downlink::hosted::EventDownlinkHandle,
agent_model::downlink::EventDownlinkHandle,
event_handler::{EventHandler, HandlerAction, HandlerActionExt},
lanes::{CommandLane, ValueLane},
lifecycle, projections,
Expand Down
2 changes: 1 addition & 1 deletion example_apps/local_downlink/src/consumer/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use swimos::agent::{
agent_lifecycle::HandlerContext,
agent_model::downlink::hosted::ValueDownlinkHandle,
agent_model::downlink::ValueDownlinkHandle,
event_handler::{EventHandler, HandlerAction, HandlerActionExt},
lanes::{CommandLane, ValueLane},
lifecycle, projections,
Expand Down
2 changes: 1 addition & 1 deletion example_apps/map_downlink/src/consumer/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use example_util::format_map;
use swimos::agent::{
agent_lifecycle::HandlerContext,
agent_model::downlink::hosted::MapDownlinkHandle,
agent_model::downlink::MapDownlinkHandle,
event_handler::{EventHandler, HandlerAction, HandlerActionExt},
lanes::{CommandLane, ValueLane},
lifecycle, projections,
Expand Down
2 changes: 1 addition & 1 deletion example_apps/value_downlink/src/consumer/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use swimos::agent::{
agent_lifecycle::HandlerContext,
agent_model::downlink::hosted::ValueDownlinkHandle,
agent_model::downlink::ValueDownlinkHandle,
event_handler::{EventHandler, HandlerAction, HandlerActionExt},
lanes::{CommandLane, ValueLane},
lifecycle, projections,
Expand Down
2 changes: 1 addition & 1 deletion server/swimos_agent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub mod agent_lifecycle;
/// and stores.
pub mod agent_model;

/// Configuration types for downlinks started from agent lifecycles.
/// Configuration types for downlinks that are started from agent lifecycles.
pub mod config;

/// Traits and builders for constructing downlink lifecycles for downlinks started from agent lifecycles.
Expand Down
4 changes: 2 additions & 2 deletions server/swimos_server_app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ mod util;

pub use self::{
config::{RemoteConnectionsConfig, SwimServerConfig},
server::{BoxServer, Server, ServerBuilder, ServerHandle},
server::{BoxServer, Server, ServerBuilder, ServerHandle, UnresolvableRoute},
util::AgentExt,
};

pub use error::{AmbiguousRoutes, ServerBuilderError, ServerError};
pub use ratchet::deflate::DeflateConfig;
pub use ratchet::deflate::{DeflateConfig, WindowBits};
pub use swimos_introspection::IntrospectionConfig;
use swimos_utilities::byte_channel::{ByteReader, ByteWriter};

Expand Down
4 changes: 2 additions & 2 deletions server/swimos_server_app/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ mod runtime;
mod store;

pub use builder::ServerBuilder;

pub use error::UnresolvableRoute;
use tokio::sync::{mpsc, oneshot};

use crate::error::ServerError;

use self::{error::UnresolvableRoute, runtime::StartAgentRequest};
use self::runtime::StartAgentRequest;

/// A handle used to interact with a running Swim server instance. This can be used to find the interface
/// on which the server is listening, instruct the server to stop and explicitly start agents.
Expand Down
6 changes: 4 additions & 2 deletions swimos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ authors = ["Swim Inc. developers [email protected]"]
edition = "2021"

[features]
default = ["agent"]
default = []
all = ["server", "agent", "json"]
server = ["dep:swimos_server_app"]
server = ["dep:swimos_server_app", "dep:swimos_remote"]
agent = ["dep:swimos_agent", "dep:swimos_agent_derive"]
json = ["agent", "swimos_agent/json"]

Expand All @@ -19,6 +19,8 @@ swimos_recon = { path = "../api/formats/swimos_recon" }
swimos_server_app = { path = "../server/swimos_server_app", optional = true }
swimos_agent = { path = "../server/swimos_agent", optional = true }
swimos_agent_derive = { path = "../server/swimos_agent_derive", optional = true }
swimos_remote = { path = "../runtime/swimos_remote", optional = true}
swimos_form = { path = "../api/swimos_form" }

[dev-dependencies]
parking_lot = { workspace = true }
Expand Down
Loading

0 comments on commit ad941dd

Please sign in to comment.