-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from rsocket/develop
Develop
- Loading branch information
Showing
43 changed files
with
2,077 additions
and
1,793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "rsocket_rust" | ||
version = "0.3.0" | ||
version = "0.4.0" | ||
authors = ["Jeffsky <[email protected]>"] | ||
edition = "2018" | ||
license = "Apache-2.0" | ||
|
@@ -12,13 +12,14 @@ description = "rsocket-rust is an implementation of the RSocket protocol in Rust | |
[dependencies] | ||
matches = "0.1.8" | ||
log = "0.4.8" | ||
bytes = "0.5.2" | ||
bytes = "0.5.3" | ||
futures = "0.3.1" | ||
lazy_static = "1.4.0" | ||
url = "2.1.0" | ||
# reactor_rs = {git = "https://github.com/jjeffcaii/reactor-rust", branch = "develop"} | ||
|
||
[dependencies.tokio] | ||
version = "0.2.2" | ||
version = "0.2.6" | ||
default-features = false | ||
features = ["full"] | ||
|
||
|
@@ -36,6 +37,6 @@ rand = "0.7.2" | |
name = "echo" | ||
path = "examples/echo/main.rs" | ||
|
||
# [[example]] | ||
# name = "proxy" | ||
# path = "examples/proxy/main.rs" | ||
[[example]] | ||
name = "proxy" | ||
path = "examples/proxy/main.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#[macro_use] | ||
extern crate log; | ||
extern crate env_logger; | ||
extern crate futures; | ||
extern crate rsocket_rust; | ||
extern crate tokio; | ||
|
||
use futures::executor::block_on; | ||
use rsocket_rust::prelude::*; | ||
use std::error::Error; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> { | ||
env_logger::builder().format_timestamp_millis().init(); | ||
|
||
RSocketFactory::receive() | ||
.acceptor(|setup, _sending_socket| { | ||
info!("incoming socket: setup={:?}", setup); | ||
Ok(Box::new(block_on(async move { | ||
RSocketFactory::connect() | ||
.acceptor(|| Box::new(EchoRSocket)) | ||
.setup(Payload::from("I'm Rust!")) | ||
.transport("tcp://127.0.0.1:7878") | ||
.start() | ||
.await | ||
.unwrap() | ||
}))) | ||
}) | ||
.transport("tcp://127.0.0.1:7979") | ||
.serve() | ||
.await | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
edition = "2018" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.