Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/python/src/events/async/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::util;

#[pyclass]
pub struct ActorHandle {
pub handle: actor_core_rs::handle::ActorHandle,
pub handle: actor_core_rs::connection::ActorHandle,
}

#[pymethods]
Expand Down
2 changes: 1 addition & 1 deletion clients/python/src/events/sync/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::util::{self, SYNC_RUNTIME};

#[pyclass]
pub struct ActorHandle {
pub handle: actor_core_rs::handle::ActorHandle,
pub handle: actor_core_rs::connection::ActorHandle,
}

#[pymethods]
Expand Down
4 changes: 2 additions & 2 deletions clients/python/src/simple/async/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ struct ActorEvent {

#[pyclass]
pub struct ActorHandle {
handle: actor_core_rs::handle::ActorHandle,
handle: actor_core_rs::connection::ActorHandle,
event_rx: Option<mpsc::Receiver<ActorEvent>>,
event_tx: mpsc::Sender<ActorEvent>,
}

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

Self {
Expand Down
4 changes: 2 additions & 2 deletions clients/python/src/simple/sync/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ struct ActorEvent {

#[pyclass]
pub struct ActorHandle {
handle: actor_core_rs::handle::ActorHandle,
handle: actor_core_rs::connection::ActorHandle,
event_rx: Option<mpsc::Receiver<ActorEvent>>,
event_tx: mpsc::Sender<ActorEvent>,
}

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

Self {
Expand Down
2 changes: 1 addition & 1 deletion clients/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tungstenite = "0.26.2"
urlencoding = "2.1.3"

[dev-dependencies]
tracing-subscriber = "0.3.19"
tracing-subscriber = { version = "0.3.19", features = ["env-filter", "std", "registry"]}
tempfile = "3.10.1"
tokio-test = "0.4.3"
fs_extra = "1.3.0"
Expand Down
14 changes: 9 additions & 5 deletions clients/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,25 @@ rivetkit-client = "0.1.0"
### Step 2: Connect to Actor

```rust
use actor_core_client::{client::{Client, GetOptions}, drivers::TransportKind, encoding::EncodingKind};
use actor_core_client::{Client, EncodingKind, GetOrCreateOptions, TransportKind};
use serde_json::json;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Create a client connected to your RivetKit manager
let client = Client::new(
"http://localhost:6420".to_string(),
"http://localhost:6420",
TransportKind::Sse,
EncodingKind::Json
);

// Connect to a chat room actor
let chat_room = client.get("chat-room", GetOptions::default()).await?;

let chat_room = client.get_or_create(
"chat-room",
["keys-here"].into(),
GetOrCreateOptions::default()
)?.connect();

// Listen for new messages
chat_room.on_event("newMessage", |args| {
let username = args[0].as_str().unwrap();
Expand All @@ -53,7 +57,7 @@ async fn main() -> anyhow::Result<()> {
]).await?;

// When finished
chat_room.disconnect().await;
client.disconnect();

Ok(())
}
Expand Down
Loading
Loading