Rust GetEventStore TCP Client.
[Talk and exchange ideas in our dedicated Discord Server]
$all
stream).```rust extern crate eventstore; extern crate futures;
extern crate serde_json;
use eventstore::{ Connection, EventData }; use futures::Future;
fn main() { let connection = Connection::builder() .start("127.0.0.1:1113") .unwrap();
// It is not mandatory to use JSON as a data format however GetEventStore
// provides great additional value if you do so.
let payload = json!({
"is_rust_a_nice_language": true,
});
let event = EventData::json("language-poll", payload);
// All the operations are asynchronous but for the sake of this example
// we decide to wait until the server sends a response.
let result = connection
.write_events("language-stream")
.push_event(event)
.execute()
.wait()
.unwrap();
// Do something productive with the result.
} ```
That library was tested on Linux and OSX.
Contributions and bug reports are welcome!
MIT License
-Yorick Laupa