Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Nhi Tran
    @zentechnhitran
    Can you see that
    https://riker.rs/messaging/
    Riker suggests using Multi-type Messaging
    By utilizing Receive<T> and #[actor], complex message handling can be defined clearly and concisely
    If I use matching with if everything is ok
    Btw do you use clippy?
    I use vim editor, I install plug Clippy into vim.
    And in the Cargo.toml dependencies only riker and log are necessary
    I created config/riker.toml allow Riker print log :))
    fstuess
    @fstuess
    @zentechnhitran yes i read that about messaging. But i cannot see, why enums are not concise or clear.
    fstuess
    @fstuess
    @zentechnhitran i do not see log printed either and don't understand why. Will look into it tomorrow. interesting..
    fstuess
    @fstuess
    @zentechnhitran for what i see the symptom is in actor/selection.rs, line 97:
    let _ = child.try_tell(msg.clone(), sender.clone());
    yields Err(()) and is silently ignored. If you have an ├Čnfo!{ block instead of let _ = then you see Err(()).
    We have to find out where this error comes from. Unfortunately, it is a stack of Result<(),()> so no error information given. Will dig in
    fstuess
    @fstuess
    At the first glance, i don't get how the message is dispatched down the stack all the way to channels. Trying to understand.
    fstuess
    @fstuess
    I boiled it down to lib.rs lines 78ff, function pub fn take<T>... in branch if self.one_time { match self.msg.take() { Some(m) => { if m.is::<T>() { Ok(*m.downcast::<T>().unwrap()) } else { Err(()) } } None => Err(()), }
    yields Err(()). But i have no clue what is going on here, haha ;)
    Type <T> is unit (), but isn't supposed to be String?? I don't get it so far.
    Nhi Tran
    @zentechnhitran
    sure @fstuess , I think we must read source code of riker
    https://docs.rs/riker/0.3.2/riker/
    I have another method for this, I will push code, can you help me review code, thank @fstuess .
    fstuess
    @fstuess
    I do not know if i will be of help, since i am a rust beginner and wanted to use riker to set up some kind of event sourced application. Did you see what i meant with the unit error Err(())? I think the master is 0.3.2, isn't it?
    just tell when you updated your repo.
    Nhi Tran
    @zentechnhitran
    yep, I will tell you when I update my repo. I use Riker to manage NATs.
    Chris Zempel
    @ZempTime
    Beyond the actual directory structure, are there any visualization tools in relation to Riker?
    davideps
    @davideps
    Hi folks. I'm new to Rust and am looking for an actor framework. Today I read through the actix and riker documentation. In actix, actors live in a context that may have multiple threads available. What is the relationship between riker actors and threads/processes? I'm currently interested in balancing load on a single multicore machine, not a cluster (yet).
    davideps
    @davideps
    Did I ask a difficult (or irrelevant) question--or is this lobby not active these days?
    Matt Johnston
    @mkj
    Just fairly quiet. My recollection is that there is a pool of threads that actors are launched on to handle messages, though
    Might
    Be mistaken. (This lose-focus-to-send is odd)
    davideps
    @davideps
    Thanks @mkj .
    Tupshin Harper
    @tupshin
    Hey all. I just submitted a pull request (for something very simple), but noticing how quiet the activity was, I was wondering if there are any plans to move development forward, or open it up to more contributors? Thanks
    also @zentechnhitran I'm also using NATS and riker together. Would be very interested in seeing what you are doing
    Steve Biedermann
    @hardliner66
    @tupshin I commented on your PR.
    Matt Johnston
    @mkj
    I want to have an actor continually long-polling a http server (minutes blocking), then publishing a message when it arrives. currently I've got the actor pinging itself to start a new http poll and assume the riker threadpool is big enough for one actor always blocking, but is there a better way?
    Steve Biedermann
    @hardliner66
    @mkj If you continually block one thread, it shouldn't be on the thread pool. Either start a new thread or do the polling directly in the main thread.
    Matt Johnston
    @mkj
    @hardliner66 I considered starting a new thread, but then I can't have riker supervising the new thread too
    but maybe it doesn't matter
    Charles Daniel
    @charlesdaniel
    Has anyone successfully integrated Riker with actix? I'm trying to create an ActorSystem and borrow it into the actix HttpServer::new.data but I'm afraid actix starts up a few threads for it and apparently ActorSystem can't be copied/cloned? Does Riker work across these types of threads or would each http server thread need its own ActorSystem (which would suck considering I need 1-to-1 mapping of an actor to a real world thing)?
    Matt Johnston
    @mkj
    Copy you start one actorsystem with one 'Factory' actor at startup, then use the ask pattern for the Factory to return an actorref of a new actor as required to actix?
    Could you.... i mean
    Charles Daniel
    @charlesdaniel
    I can't even seem to pass an ActorRef to the data... I don't think these ActorRefs can work across arbitrary threads made by actix?
    (also I'm very new to Rust so I likely might not be doing things right)
    Matt Johnston
    @mkj
    It looks like ActorRef has Send trait so it should work?
    Need to .clone() it?
    Charles Daniel
    @charlesdaniel
    I think the problem was actix's HttpServer::new() takes in a closure that it runs repeatedly to make like 8 worker threads... and I couldn't figure out how to make the actor.clone() inside that without it trying to move into it and errors popping up about trying to move it and failing. I ended up using a data=web::Data type struct and adding the actor_system as a Mutex::new(actor_system) within it. That let me do a App::new().app_data(data.clone()) ... and that went through just fine. On the actix handler side I just had to lock().unwrap() the mutex and use it.
    Now I'm just stuck on trying to figure out why my actor_system.select("/user/foo").unwrap().try_tell(Hello,None) isn't working... I did an actor_system.print_tree() at that spot and it seems to be there in the tree at least.
    Kev Jackson
    @foamdino
    morning
    I'm playing around with riker to build a simple actor system and I've run into an issue with actor persistence
    `fn persistence_conf(&self) -> Option<PersistenceConf> {
    }`
    This is documented in https://riker.rs/persistence/ but doesn't seem to be implemented in the code
    Kelly Thomas Kline
    @kellytk
    I've recently been thinking about the actor pattern as I'm rewriting a backend migrating from using actix/actix web to tokio and warp more directly. My ultimate goal is to comprehend first-hand why the actor pattern is still worthwhile, if indeed it is. I've also wondered why message passing cannot be more simple calls and, as I understand it, be less IO bound. I suppose it's that a benefit of the actor pattern is that inter-component communication can be done over a network in which case having first class Messages (normalized, easier to serialize/deserialize) is helpful. However, is there perhaps a more optimal compromise where components can choose? If two components are local couldn't they communicate with direct calls and upon making a component distributed provide an easy path to converting those calls to Message passes?
    rustrust
    @rustrust
    @kellytk as i understand it actix-web began using the actor model and moved away from it for performance reasons
    actors can still be used with actix-web to, for example, add async behavior to a sync db connection, but they aren't intrinsic to the code
    Kelly Thomas Kline
    @kellytk
    I don't comprehend the relevance of your reply to my question
    Christopher Lindblom
    @lindblom
    @foamdino I haven't looked at the code yet, but I also noticed today that the persistence page is only in the nav box from some pages?
    Kev Jackson
    @foamdino
    @lindblom I'm having to put my mini-project on hold as without persistence working, the investigation I'm doing is pointless (unfortunately)
    Christopher Lindblom
    @lindblom
    @foamdino i looked at the code and there is some persistance thingy in https://github.com/riker-rs/riker/blob/master/src/system/persist.rs. But it doesn't seem to be exported by the module.
    Mihail Malo
    @qm3ster
    BUT WHAT IF RIKER IS NOT KILL?!