by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mina Galić (deprecated: Igor Galić)
    @igalic
    https://riker.rs/actors/ link here on the bottom leads to: https://riker.rs/actors/messaging which is wrong, it needs to point to: https://riker.rs/messaging/
    oh, they are all wrong.
    i should submit a PR to fix that.
    Mina Galić (deprecated: Igor Galić)
    @igalic
    oh, and the website repo also needs .gitattributes
    Mina Galić (deprecated: Igor Galić)
    @igalic
    Mina Galić (deprecated: Igor Galić)
    @igalic
    maybe this advanced messaging page is where we could learn how to pass arguments to messages… so that Add would not only add 1, but, whatever we tell it to, maybe even 3!
    Daniel Olano
    @olanod
    Hi! I'm practicing Riker trying to create an event sourcing abstraction, and got a bit blocked trying to decide how to run a future inside a recv function https://github.com/olanod/riker-es/blob/cqrs/src/entity.rs#L61 I thought ctx.run would run the future already but seems it doesn't and so far the only way I see is doing block_on but I run into the error cannot executeLocalPoolexecutor from within another executor I guess block_on is not meant to be run inside recv? is it because of my #[tokio::test]?
    Mina Galić (deprecated: Igor Galić)
    @igalic
    @olanod a potential solution to your problem might be found here in the documentation: https://riker.rs/futures/
    Tom Burdick
    @bfrog
    Is there a simple way to get Riker to log when actors are started/stopped/etc, much like the erlang supervisor progress
    I see that when that stuff happens there's the sys_event channel, would subscribing to that get me what I want?
    Tom Burdick
    @bfrog
    I got it!
    Daniel Olano
    @olanod
    Thanks @igalic but not sure how the info in the docs can help me more, doesn't say much other than mentioning ctx.run exists to run futures :/ has anyone working examples of a futures used inside a the recv function? :)
    Mina Galić (deprecated: Igor Galić)
    @igalic
    @bfrog wanna share how you did it?
    riker-rs/website#46 / riker-rs/website#47 ← fixes example on website to compile.
    Mina Galić (deprecated: Igor Galić)
    @igalic
    can somebody explain where ctx comes from, here: https://riker.rs/channels/ https://riker.rs/selection/ ?
    Mina Galić (deprecated: Igor Galić)
    @igalic

    The ActorSystem is the heart of a Riker application, starting several threads when it is created. Create only one instance of ActorSystem per application.

    so, if i create the ActorSystem in main(), how do i access it in a different part of the application?

    do i have to share a ref? or can i get that somehow "by-name"?
    Lee Smith
    @leenozara
    ctx is passed as a parameter to trait methods of Actor, e.g. recv.
    system can be accessed from context using ctx.system
    Mina Galić (deprecated: Igor Galić)
    @igalic
    @leenozara so if i understand you correctly, if i start the ActorSystem in main() there's no way to get an ActorRef in some disparate part of my application, other than passing an actor or a system, or a reference to those, into that part of the application
    Lee Smith
    @leenozara
    that's right. You need some Riker type to interact with the Riker API. This can be ActorSystem, ActorRef, BasicActorRef.
    within the actor system you have access to any actor references that you provide through endowment and introduction, etc. You also can walk up and down the hierarchy by accessing parents and chilkdren.
    There's also .select on Context and System, which is helpful for interacting with actors through system messages and in some cases user-level messages.
    outside of the actor system you don't have Context, but you are free to pass ActorRef, ActorSystem, etc if you have parts of an application that are not an actor themselves
    Lee Smith
    @leenozara
    I'm not sure if that answers your question exactly. I'm be happy to help in more detail if you can describe your application and what you had in mind.
    Mina Galić (deprecated: Igor Galić)
    @igalic
    so yes, i would like to have a part of the application, which is not in the actor system, send a message to an actor to do jobs
    the reason to do so, is to decouple all the data that we're currently passing around, which, in my youthful zeal, i have, wrongly bundled into a single struct
    there's a database connection, a worker mutex, and a search index ref. (among others
    Mina Galić (deprecated: Igor Galić)
    @igalic
    my thought was that Searcher would lend itself to easily extract into an actor, but it is, itself deeply bundled with two other datastructures, one of them, the post struct, and the other the database connection, because the post struct doesn't hold all data, that Searcher stores about a page
    but, if the Sender isn't part of the ActorSystem i need to pass around a ref, just like with the database connection, and, in my naïvité, i thought i could avoid that, but knowing the actor's name
    Mina Galić (deprecated: Igor Galić)
    @igalic
    on the other hand, i would still be able to talk to three different Actors (broadcast actor, Searcher actor, mail actor) they just one sys ref, instead of three different ones! so that's still a big win
    and that's just the three actors I've identified so far
    i haven't looked into how we compute notifications yes, cuz i was afraid of what I'd find, lol
    Mina Galić (deprecated: Igor Galić)
    @igalic
    I'm really glad i don't have that much time to write code, it leaves much more time for thinking
    Terrence Drozdowski
    @tdrozdowski
    Have a quick question - when you are using channels - are you restricted to using tell with them? Or can you use ask as well?
    Daniel Olano
    @olanod
    Hi all! looking for some inspiration :) ... I'm trying to store references to different kinds of entities in a HashMap, since I can not put different ActorRef together because they are generic over the message type I figured I can do a HashMap of BasicActorRef but I'd like to go back to ActorRef from BasicActorRef later on, is it possible? I see there is a typed function but needs an ExtendedCell as parameter, no idea where to get that, looks like an internal type
    Georg Aigner
    @basalt79
    hi, are there any examples for riker create http rest endpoints and expose them via http
    Terrence Drozdowski
    @tdrozdowski
    @olanod - I had a similar requirement - I just use BasicActorRef and use try_tell - the gotcha is looking out for issue #129. There is a work around there where you just need to be explicit when you send your message type in.
    @here - Is there any documentation around how to explicitly manage child actors? I have a scenario where I want to shut down a child actor once its done. Looking at Context.shutdown() or explicitly using a Stop message. Akka has a PoisonPill which would kill the actor once it hit that message in the mailbox. Anything similar? And what are the rules when ActorTerminated system message is sent to the parent? Is this before or after the child is shutdown and removed from the children list?
    Daniel Olano
    @olanod
    Thanks @tdrozdowski that's what I ended up doing ;) also needed the ask function to work for those BasicActorRefs so I ended up implementing my own ask copy that uses try_tell(perhaps a nice feature to include?)
    Andrew Bastien
    @volundmush
    What kind of approach are people taking to make a Riker application that involves networking?
    George Malayil Philip
    @georgemp
    Hi. are there any examples out there on how to send a message to an actor, and, await it’s response (perhaps, something similar to the one on actix with it’s Ping). I guess if i’m sending a message from an actor, i could include it’s address in the send, and, message a response back. But, what if i’m sending it from main etc?
    oh..i guess i’d use the ask pattern
    George Malayil Philip
    @georgemp
    if i send a message between two actors (say, add 2 + 2) - in order to handle the response (assuming, i do a send back from the compute actor to the asking actor), would my message necessarily also need to include a id of sorts? Wondering what would happen if i send two messages (2,2) and (3,3) one after the other? would the responses be sent back in order? thanks
    Daniel Olano
    @olanod
    @georgemp I haven't confirmed it yet(and perhaps you did already?) but my assumption is that because messages arrive to the letter inbox in order because you send them in order from the same place and from there are handed one by one to the handler, on the way back the same should happen and you would get things in order unless you do some async stuff when processing the messages
    George Malayil Philip
    @georgemp
    @olanod thanks..i ended up trying to just use tokio msg channels directly instead of Riker..might revisit it, if that doesn’t work out :)
    vepqrtx
    @vepqrtx_gitlab
    Is it possible to configure riker to use the Tracing logger? It seems that when I start my actor system it hijacks the logging away from Tracing?
    vepqrtx
    @vepqrtx_gitlab
    Also, is it possible with the built in config implementation to pull in environment variables? the Config crate supports this but it doesn't seem to occur in my testing.
    vepqrtx
    @vepqrtx_gitlab
    Also how do I compose async functions within riker actors?