Skip to content

Commit

Permalink
Merge pull request #19 from slawlor/tweak2
Browse files Browse the repository at this point in the history
Adding public modifier to startup arguments
  • Loading branch information
slawlor authored Feb 11, 2024
2 parents e8df989 + b183f0e commit e7e0e88
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ractor_actors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ractor_actors"
version = "0.3.0"
version = "0.4.0"
authors = ["Sean Lawlor"]
description = "Helpful actors built with Ractor"
documentation = "https://docs.rs/ractor_actors"
Expand Down
14 changes: 9 additions & 5 deletions ractor_actors/src/net/tcp/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ where
encryption: IncomingEncryptionMode,
}

pub struct TcpListenerStartupArgs<R>
/// Arguments to startup a TcpListener
pub struct ListenerStartupArgs<R>
where
R: SessionAcceptor,
{
port: super::NetworkPort,
encryption: IncomingEncryptionMode,
acceptor: R,
/// Port to listen on
pub port: super::NetworkPort,
/// Encryption settings for incoming sockets
pub encryption: IncomingEncryptionMode,
/// Callback module for accepted sockets
pub acceptor: R,
}

pub struct ListenerMessage;
Expand All @@ -67,7 +71,7 @@ where
R: SessionAcceptor,
{
type Msg = ListenerMessage;
type Arguments = TcpListenerStartupArgs<R>;
type Arguments = ListenerStartupArgs<R>;
type State = ListenerState<R>;

async fn pre_start(
Expand Down
6 changes: 4 additions & 2 deletions ractor_actors/src/net/tcp/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ pub struct TcpSessionStartupArguments<R>
where
R: FrameReceiver,
{
receiver: R,
tcp_session: NetworkStream,
/// The callback implementation for received for messages
pub receiver: R,
/// The tcp session to creat the sesson upon
pub tcp_session: NetworkStream,
}

/// A tcp-session management actor
Expand Down

0 comments on commit e7e0e88

Please sign in to comment.