riker-rs / website Goto Github PK
View Code? Open in Web Editor NEWRiker.rs website
Home Page: https://riker.rs
License: MIT License
Riker.rs website
Home Page: https://riker.rs
License: MIT License
Hello,
the example here (found on https://riker.rs/actors/):
use std::time::Duration;
use riker::actors::*;
struct MyActor;
// implement the Actor trait
impl Actor for MyActor {
type Msg = String;
fn recv(&mut self,
_ctx: &Context<String>,
msg: String,
_sender: Sender) {
println!("Received: {}", msg);
}
}
// start the system and create an actor
fn main() {
let sys = ActorSystem::new().unwrap();
let my_actor = sys.actor_of::<MyActor>("my-actor").unwrap();
my_actor.tell("Hello my actor!".to_string(), None);
// force main to wait before exiting program
std::thread::sleep(Duration::from_millis(500));
}
does not compile, because:
error[E0277]: the trait bound `MyActor: Default` is not satisfied
--> src/main.rs:23:24
|
23 | let my_actor = sys.actor_of::<MyActor>("my-actor").unwrap();
| ^^^^^^^^ the trait `Default` is not implemented for `MyActor`
|
= note: required because of the requirements on the impl of `ActorFactory` for `MyActor`
This is on riker = "0.4"
, with cargo 1.50.0 (f04e7fab7 2021-02-04)
and rustc 1.50.0 (cb75ad5db 2021-02-10)
.
The pencil on the right of the title to edit a page on the website redirects to a 404.
as "discovered" in #44, an "advanced messaging" documentation page is promised, but sadly missing
For simplicity sake, let's suppose the pages titles are page1, page2, page3, ...
On the website, the link at the bottom of page1 point to .../page1/page2
instead of just .../page2
.
E.g. at the bottom of https://riker.rs/messaging/
, you have a link to https://riker.rs/messaging/hierarchy
instead of https://riker.rs/hierarchy/
.
It seems to be the case on all pages I checked.
Next and Previous (with huge arrows) from mkdocs at the bottom are OK.
$ curl -I https://riker.rs/static/favicon-adaa08fd430281689affd43af67cc675.png
HTTP/2 200
content-type: image/png
content-length: 65687989
date: Tue, 08 Oct 2019 00:26:54 GMT
the Multi-type Messaging example on the website does not compile.
Apart from missing use
statements:
use std::time::Duration;
use riker::actors::*;
it still is wrong:
# cargo build
Compiling website-examples v0.1.0 (/home/meena/src/riker-rs/website-examples)
error[E0277]: the trait bound `Counter: std::default::Default` is not satisfied
--> src/main.rs:71:17
|
71 | let props = Props::new::<Counter>();
| ^^^^^^^^^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `Counter`
|
::: /home/meena/.cargo/registry/src/github.com-1ecc6299db9ec823/riker-0.4.1/src/actor/props.rs:182:12
|
182 | A: ActorFactory,
| ------------ required by this bound in `riker::actor::props::Props::new`
|
= note: required because of the requirements on the impl of `riker::actor::props::ActorFactory` for `Counter`
error[E0308]: mismatched types
--> src/main.rs:72:36
|
72 | let actor = sys.actor_of_props(props, "counter").unwrap();
| ^^^^^ expected `&str`, found struct `std::sync::Arc`
|
::: /home/meena/.cargo/registry/src/github.com-1ecc6299db9ec823/riker-0.4.1/src/actor/props.rs:180:34
|
180 | pub fn new<A>() -> Arc<Mutex<impl ActorProducer<Actor = A>>>
| ----------------------------- the found opaque type
|
= note: expected reference `&str`
found struct `std::sync::Arc<std::sync::Mutex<impl riker::actor::props::ActorProducer>>`
error[E0308]: mismatched types
--> src/main.rs:72:43
|
72 | let actor = sys.actor_of_props(props, "counter").unwrap();
| ^^^^^^^^^ expected struct `std::sync::Arc`, found `&str`
|
= note: expected struct `std::sync::Arc<std::sync::Mutex<(dyn riker::actor::props::ActorProducer<Actor = _> + 'static)>>`
found reference `&'static str`
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `website-examples`.
To learn more, run the command again with --verbose.
Hi! Just to let you know that the slanted section separators of this site cause content to be hidden on wide screen resolutions, my monitor is 2560x1440. The FAQ button starts to become obscured at around 1920 pixels wide.
See following screenshot of issue, note that primary navigation buttons and background images at the top of the page are obscured partly or entirely:
I tried to look at how to fix it, in order to submit a PR, but I'm not very good at CSS and couldn't figure it out I'm afraid.
Please can you elaborate on messaging.
Can messages can be delivered out of order?
What are the guarantees?
What if Actor A send multiple messages to Actor B?
What if Actor A and Actor B send multiple messages to Actor C?
Thank you.
I've just found riker by looking at the crates.io homepage, and went to check out http://riker.rs.
This site doesn't seem to have any link to the repos on github, and neither do the crates in their Cargo.toml files (so crates.io doesn't link to the code either). As I really enjoy reading the implementation of a library before using it, this was very confusing, especially as all that is needed was a single link to https://github.com/riker-rs to find all the goodness :)
The current entry on "does riker
use unsafe
code?" states:
Riker does not use unsafe for any memory management. We believe it's better to work with the Borrow Checker and compiler than against them.
unsafe is only used to explicitly mark a few types as Send or Sync to assist the compiler. Both of these have empty implementations, i.e. no actual unsafe code:
unsafe impl<T: Message> Send for Envelope<T> {}
This is slightly skirting around an issue: Incorrect Send
and Sync
implementations can trigger memory issues and undefined behaviour. unsafe
trait implementations are as thorny (and sometimes even more dangerous, because they look so innocuous) as a line of unsafe code.
So, this is actual unsafe code (because it will be composed with other safe code that will assume those operations to be safe) and the statements are promises to the compiler. It also affects memory management, particularly, Sync
types will be assumed to be safe to access from multiple components.
I think there's a stronger point to make: riker does use unsafe minimally for statements that the compiler can't make and only on its core competencies (providing safe concurrency primitives). It avoids unsafe for other cases and finds safe and fast abstractions instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.