Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Akka.Actor: IStash improvements - programmatic bounded stash configuration and stash capacity APIs #6658

Closed
2 tasks done
Aaronontheweb opened this issue Apr 21, 2023 · 3 comments · Fixed by #6660
Closed
2 tasks done

Comments

@Aaronontheweb
Copy link
Member

Aaronontheweb commented Apr 21, 2023

  • Add IStash APIs to track whether there's any content inside the IStash at all
  • Make it possible to configure bounded stash size programmatically via Props

Is your feature request related to a problem? Please describe.

I'm working on a prototype of reliable delivery for Akka.NET #4720 over at https://github.com/Aaronontheweb/Aaron.Akka.ReliableDelivery, and stashing is pretty integral to how the ConsumerController manages confirmations for both push and pull-based deliveries.

Unfortunately, we're missing some important APIs I need to complete the job over there:

  • IStash,IsEmpty - is there anything inside the stash I need to process first?
  • IStash.Count - how many messages are left inside the stash?
  • And finally, a programmatic way of setting a bounded stash size - this is currently not feasible to do.

Describe the solution you'd like

Expand the IStash interface to some new properties:

    public interface IStash
    {
        // existing methods

       bool IsEmpty { get; }
       
      // are we at capacity?
      bool IsFull { get; }
    
      // is Count > 0
      bool NonEmpty { get; }

       int Count { get; }
       
    }

That will help give me the ability to reason about working with bounded stashes internally inside these actors.

In addition to that, I would like to add StashSize as a property that can be set via Props on actors. That way, this can be configured programmatically or via HOCON.

cc @ismaelhamed

@Aaronontheweb Aaronontheweb added this to the 1.5.4 milestone Apr 21, 2023
@Aaronontheweb Aaronontheweb changed the title Akka.Actor: IStash improvements Akka.Actor: IStash improvements - programmatic bounded stash configuration and stash capacity APIs Apr 21, 2023
@Aaronontheweb
Copy link
Member Author

In addition to that, I think the way Stash.Unstash works is wrong and has been wrong for nearly 10 years - it's currently a LIFO mechanism, when it should probably work as FIFO. I'm going to file a separate issue for that - but that problem will also need to be resolved before I can complete #4720.

This turned out to be wrong. I checked. Stash.Unstash is FIFO.

Aaronontheweb added a commit to Aaronontheweb/akka.net that referenced this issue Apr 21, 2023
Add APIs to track content of Stash
Aaronontheweb added a commit that referenced this issue Apr 24, 2023
* close #6658

Add APIs to track content of Stash

* added basic stashing test cases

* updated API approvals

---------

Co-authored-by: Gregorius Soedharmo <arkatufus@yahoo.com>
@Aaronontheweb Aaronontheweb reopened this Apr 24, 2023
@Aaronontheweb
Copy link
Member Author

Reopening because this issue is only half-complete.

@Aaronontheweb
Copy link
Member Author

Completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant