Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 9e4ec66

Browse files
committed
feat: update rust to 0.9.0
1 parent a9b43d8 commit 9e4ec66

File tree

24 files changed

+1309
-976
lines changed

24 files changed

+1309
-976
lines changed

clients/python/src/events/async/handle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::util;
66

77
#[pyclass]
88
pub struct ActorHandle {
9-
pub handle: actor_core_rs::handle::ActorHandle,
9+
pub handle: actor_core_rs::connection::ActorHandle,
1010
}
1111

1212
#[pymethods]

clients/python/src/events/sync/handle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::util::{self, SYNC_RUNTIME};
55

66
#[pyclass]
77
pub struct ActorHandle {
8-
pub handle: actor_core_rs::handle::ActorHandle,
8+
pub handle: actor_core_rs::connection::ActorHandle,
99
}
1010

1111
#[pymethods]

clients/python/src/simple/async/handle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ struct ActorEvent {
1414

1515
#[pyclass]
1616
pub struct ActorHandle {
17-
handle: actor_core_rs::handle::ActorHandle,
17+
handle: actor_core_rs::connection::ActorHandle,
1818
event_rx: Option<mpsc::Receiver<ActorEvent>>,
1919
event_tx: mpsc::Sender<ActorEvent>,
2020
}
2121

2222
impl ActorHandle {
23-
pub fn new(handle: actor_core_rs::handle::ActorHandle) -> Self {
23+
pub fn new(handle: actor_core_rs::connection::ActorHandle) -> Self {
2424
let (event_tx, event_rx) = mpsc::channel(EVENT_BUFFER_SIZE);
2525

2626
Self {

clients/python/src/simple/sync/handle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ struct ActorEvent {
1414

1515
#[pyclass]
1616
pub struct ActorHandle {
17-
handle: actor_core_rs::handle::ActorHandle,
17+
handle: actor_core_rs::connection::ActorHandle,
1818
event_rx: Option<mpsc::Receiver<ActorEvent>>,
1919
event_tx: mpsc::Sender<ActorEvent>,
2020
}
2121

2222
impl ActorHandle {
23-
pub fn new(handle: actor_core_rs::handle::ActorHandle) -> Self {
23+
pub fn new(handle: actor_core_rs::connection::ActorHandle) -> Self {
2424
let (event_tx, event_rx) = mpsc::channel(EVENT_BUFFER_SIZE);
2525

2626
Self {

clients/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tungstenite = "0.26.2"
2424
urlencoding = "2.1.3"
2525

2626
[dev-dependencies]
27-
tracing-subscriber = "0.3.19"
27+
tracing-subscriber = { version = "0.3.19", features = ["env-filter", "std", "registry"]}
2828
tempfile = "3.10.1"
2929
tokio-test = "0.4.3"
3030
fs_extra = "1.3.0"

clients/rust/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,25 @@ actor-core-client = "0.1.0"
2424
### Step 2: Connect to Actor
2525

2626
```rust
27-
use actor_core_client::{client::{Client, GetOptions}, drivers::TransportKind, encoding::EncodingKind};
27+
use actor_core_client::{Client, EncodingKind, GetOrCreateOptions, TransportKind};
2828
use serde_json::json;
2929

3030
#[tokio::main]
3131
async fn main() -> anyhow::Result<()> {
3232
// Create a client connected to your ActorCore manager
3333
let client = Client::new(
34-
"http://localhost:6420".to_string(),
34+
"http://localhost:6420",
3535
TransportKind::Sse,
3636
EncodingKind::Json
3737
);
3838

3939
// Connect to a chat room actor
40-
let chat_room = client.get("chat-room", GetOptions::default()).await?;
41-
40+
let chat_room = client.get_or_create(
41+
"chat-room",
42+
["keys-here"].into(),
43+
GetOrCreateOptions::default()
44+
)?.connect();
45+
4246
// Listen for new messages
4347
chat_room.on_event("newMessage", |args| {
4448
let username = args[0].as_str().unwrap();
@@ -53,7 +57,7 @@ async fn main() -> anyhow::Result<()> {
5357
]).await?;
5458

5559
// When finished
56-
chat_room.disconnect().await;
60+
client.disconnect();
5761

5862
Ok(())
5963
}

0 commit comments

Comments
 (0)