Show / Hide Table of Contents

Class PhobosStash

We've exposed this, experimentally, for customers who need to do custom stashing. We might very well seal it off again. Use it at your own risk.

Inheritance
object
PhobosStash
Implements
IPhobosStash
IStash
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Phobos.Actor.Impl
Assembly: Phobos.Actor.dll
Syntax
[InternalApi]
public class PhobosStash : IPhobosStash, IStash

Constructors

PhobosStash(IActorContext, bool)

Used to create a new instance of the PhobosStash

Declaration
public PhobosStash(IActorContext phobosContext, bool isUnbounded = false)
Parameters
Type Name Description
IActorContext phobosContext

The context of the current actor who has the stash.

bool isUnbounded

Indicates whether this IStash is unbounded or not.

Properties

Capacity

The total capacity of the stash.

Declaration
public int Capacity { get; }
Property Value
Type Description
int

Count

The number of messages currently inside the stash.

Declaration
public int Count { get; }
Property Value
Type Description
int

IsEmpty

Returns true when Count is zero.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
bool

IsFull

When using a bounded stash, this returns true when the stash is full.

Declaration
public bool IsFull { get; }
Property Value
Type Description
bool
Remarks

Always returns false when using an unbounded stash.

NonEmpty

Returns true when Count is greater than zero.

Declaration
public bool NonEmpty { get; }
Property Value
Type Description
bool

Methods

ClearStash()

Eliminates the contents of the IStash, and returns the previous contents of the messages.

Declaration
public IEnumerable<Envelope> ClearStash()
Returns
Type Description
IEnumerable<Envelope>

Previously stashed messages.

Prepend(IEnumerable<Envelope>)

Prepend a set of envelopes to the front of the stash.

Declaration
public void Prepend(IEnumerable<Envelope> envelopes)
Parameters
Type Name Description
IEnumerable<Envelope> envelopes

TBD

Stash()

Stashes the current message (the message that the actor received last)

Declaration
public void Stash()

Unstash()

Unstash the oldest message in the stash and prepends it to the actor's mailbox. The message is removed from the stash.

Declaration
public void Unstash()

UnstashAll()

Unstash all of the Envelopes in the Stash.

Declaration
public void UnstashAll()

UnstashAll(Func<Envelope, bool>)

Unstash all of the Envelopes in the Stash.

Declaration
public void UnstashAll(Func<Envelope, bool> predicate)
Parameters
Type Name Description
Func<Envelope, bool> predicate

A predicate function to determine which messages to select.

Implements

IPhobosStash
IStash
In this article

Phobos®

APM for Akka.NET Applications

© 2025 Petabridge®

All rights reserved

Product
  • Purchase Phobos
  • Contact Sales
  • Phobos Quick Start Guide
  • Phobos Features
  • API Documentation
  • Release Notes
Resources
  • Akka.NET Documentation
  • Petabridge Blog
  • Akka.NET Support Plans
  • Akka.NET Consulting Services
  • Akka.NET Training
Connect
  • Petabridge Website
  • GitHub
  • Twitter
  • LinkedIn
  • YouTube
  • Contact Us
Privacy Policy
Built with ♥ by Petabridge