Skip to content

Commit 1017720

Browse files
committed
Merge branch 'main' of https://github.com/swimos/swim-rust into aggregations_agent
2 parents c699fee + 36cd081 commit 1017720

File tree

167 files changed

+2157
-1791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+2157
-1791
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ members = [
3939
"example_apps/join_map",
4040
"example_apps/join_value",
4141
"example_apps/aggregations",
42+
"example_apps/time_series",
4243
]
4344

4445
exclude = [
@@ -93,7 +94,7 @@ ratchet_fixture = "0.4"
9394
flate2 = "1.0.22"
9495
bitflags = "2.5"
9596
rocksdb = "0.22"
96-
integer-encoding = "3.0.4"
97+
integer-encoding = "4.0.0"
9798
rustls = "0.20"
9899
webpki = "0.22"
99100
webpki-roots = "0.22"
@@ -124,7 +125,7 @@ serde-xml-rs = "0.6"
124125
axum = "0.6.20"
125126
hyper-staticfile = "0.9"
126127
httparse = "1.8"
127-
sha1 = "0.10"
128+
sha-1 = "0.10.1"
128129
waker-fn = "1.1.0"
129130
num = "0.4"
130131
smol_str = "0.2.0"

docs/event_handler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The `HandlerContext`.
9090
The aid in the construction of event handlers, a factor type is provided in the form of:
9191

9292
```rust
93-
swimos::agent::agent_lifecycle::utility::HandlerContext<AgentType>
93+
swimos::agent::agent_lifecycle::HandlerContext<AgentType>
9494
```
9595

9696
This allows for the easier construction of event handlers that will run in the context of the `AgentType`. Typically, in

example_apps/aggregations/src/area.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rand::seq::SliceRandom;
2020

2121
use swimos::agent::event_handler::HandlerActionExt;
2222
use swimos::{
23-
agent::agent_lifecycle::utility::HandlerContext,
23+
agent::agent_lifecycle::HandlerContext,
2424
agent::event_handler::EventHandler,
2525
agent::lanes::{CommandLane, JoinValueLane, ValueLane},
2626
agent::lifecycle,
@@ -140,8 +140,10 @@ impl AreaLifecycle {
140140
format!("/cars/{car_id}").as_str(),
141141
"speed",
142142
)
143-
.boxed(),
144-
Action::Deregister(car_id) => context.remove_downlink(AreaAgent::CARS, *car_id).boxed(),
143+
.boxed_local(),
144+
Action::Deregister(car_id) => context
145+
.remove_downlink(AreaAgent::CARS, *car_id)
146+
.boxed_local(),
145147
}
146148
}
147149
#[on_update(cars)]

example_apps/aggregations/src/car.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rand::Rng;
1919

2020
use swimos::agent::stores::ValueStore;
2121
use swimos::{
22-
agent::agent_lifecycle::utility::HandlerContext,
22+
agent::agent_lifecycle::HandlerContext,
2323
agent::event_handler::{EventHandler, HandlerActionExt},
2424
agent::lanes::ValueLane,
2525
agent::{lifecycle, projections, AgentLaneModel},

example_apps/aggregations/src/city.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::collections::HashMap;
1616
use swimos::{
17-
agent::agent_lifecycle::utility::HandlerContext,
17+
agent::agent_lifecycle::HandlerContext,
1818
agent::event_handler::EventHandler,
1919
agent::lanes::ValueLane,
2020
agent::lanes::{CommandLane, JoinValueLane},

example_apps/command_lane/src/agent.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
use swimos::agent::{
16-
agent_lifecycle::utility::HandlerContext,
16+
agent_lifecycle::HandlerContext,
1717
event_handler::{EventHandler, HandlerActionExt},
1818
lanes::{CommandLane, ValueLane},
1919
lifecycle, projections, AgentLaneModel,
@@ -76,12 +76,12 @@ impl ExampleLifecycle {
7676
cmd: &Instruction,
7777
) -> impl EventHandler<ExampleAgent> {
7878
match *cmd {
79-
Instruction::Zero => context.set_value(ExampleAgent::LANE, 0).boxed(),
79+
Instruction::Zero => context.set_value(ExampleAgent::LANE, 0).boxed_local(),
8080
Instruction::Add(n) => context
8181
.get_value(ExampleAgent::LANE)
8282
.and_then(move |v| context.set_value(ExampleAgent::LANE, v + n))
83-
.boxed(),
84-
Instruction::Stop => context.stop().boxed(),
83+
.boxed_local(),
84+
Instruction::Stop => context.stop().boxed_local(),
8585
}
8686
}
8787
}

example_apps/demand_lane/src/agent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use std::time::Duration;
1616

1717
use swimos::agent::{
18-
agent_lifecycle::utility::HandlerContext,
18+
agent_lifecycle::HandlerContext,
1919
event_handler::{EventHandler, HandlerAction, HandlerActionExt},
2020
lanes::{DemandLane, ValueLane},
2121
lifecycle, projections, AgentLaneModel,

example_apps/demand_map_lane/src/agent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use std::collections::HashMap;
1616

1717
use swimos::agent::{
18-
agent_lifecycle::utility::HandlerContext,
18+
agent_lifecycle::HandlerContext,
1919
event_handler::{EventHandler, HandlerAction, HandlerActionExt},
2020
lanes::{CommandLane, DemandMapLane},
2121
lifecycle, projections, AgentLaneModel,

example_apps/event_downlink/src/consumer/agent.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
use swimos::agent::{
16-
agent_lifecycle::utility::HandlerContext,
16+
agent_lifecycle::HandlerContext,
1717
agent_model::downlink::hosted::EventDownlinkHandle,
1818
event_handler::{EventHandler, HandlerAction, HandlerActionExt},
1919
lanes::{CommandLane, ValueLane},
@@ -101,15 +101,15 @@ impl ConsumerLifecycle {
101101
),
102102
})
103103
.discard()
104-
.boxed(),
104+
.boxed_local(),
105105
Instruction::CloseLink => handle
106106
.with_mut(|h| {
107107
if let Some(h) = h.as_mut() {
108108
h.stop();
109109
}
110110
})
111-
.boxed(),
112-
Instruction::Stop => context.stop().boxed(),
111+
.boxed_local(),
112+
Instruction::Stop => context.stop().boxed_local(),
113113
};
114114
context
115115
.effect(move || println!("{}", msg))

example_apps/event_downlink/src/producer/agent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
use swimos::agent::{
16-
agent_lifecycle::utility::HandlerContext,
16+
agent_lifecycle::HandlerContext,
1717
event_handler::{EventHandler, HandlerActionExt},
1818
lanes::ValueLane,
1919
lifecycle, projections, AgentLaneModel,

0 commit comments

Comments
 (0)