File tree 6 files changed +52
-3
lines changed
6 files changed +52
-3
lines changed Original file line number Diff line number Diff line change @@ -1134,6 +1134,10 @@ namespace Akka.Actor
1134
1134
}
1135
1135
public interface IStash
1136
1136
{
1137
+ int Count { get; }
1138
+ bool IsEmpty { get; }
1139
+ bool IsFull { get; }
1140
+ bool NonEmpty { get; }
1137
1141
System.Collections.Generic.IEnumerable<Akka.Actor.Envelope> ClearStash();
1138
1142
void Prepend(System.Collections.Generic.IEnumerable<Akka.Actor.Envelope> envelopes);
1139
1143
void Stash();
@@ -1933,6 +1937,10 @@ namespace Akka.Actor.Internal
1933
1937
public abstract class AbstractStash : Akka.Actor.IStash
1934
1938
{
1935
1939
protected AbstractStash(Akka.Actor.IActorContext context) { }
1940
+ public int Count { get; }
1941
+ public bool IsEmpty { get; }
1942
+ public bool IsFull { get; }
1943
+ public bool NonEmpty { get; }
1936
1944
public System.Collections.Generic.IEnumerable<Akka.Actor.Envelope> ClearStash() { }
1937
1945
public void Prepend(System.Collections.Generic.IEnumerable<Akka.Actor.Envelope> envelopes) { }
1938
1946
public void Stash() { }
Original file line number Diff line number Diff line change @@ -1132,6 +1132,10 @@ namespace Akka.Actor
1132
1132
}
1133
1133
public interface IStash
1134
1134
{
1135
+ int Count { get; }
1136
+ bool IsEmpty { get; }
1137
+ bool IsFull { get; }
1138
+ bool NonEmpty { get; }
1135
1139
System.Collections.Generic.IEnumerable<Akka.Actor.Envelope> ClearStash();
1136
1140
void Prepend(System.Collections.Generic.IEnumerable<Akka.Actor.Envelope> envelopes);
1137
1141
void Stash();
@@ -1931,6 +1935,10 @@ namespace Akka.Actor.Internal
1931
1935
public abstract class AbstractStash : Akka.Actor.IStash
1932
1936
{
1933
1937
protected AbstractStash(Akka.Actor.IActorContext context) { }
1938
+ public int Count { get; }
1939
+ public bool IsEmpty { get; }
1940
+ public bool IsFull { get; }
1941
+ public bool NonEmpty { get; }
1934
1942
public System.Collections.Generic.IEnumerable<Akka.Actor.Envelope> ClearStash() { }
1935
1943
public void Prepend(System.Collections.Generic.IEnumerable<Akka.Actor.Envelope> envelopes) { }
1936
1944
public void Stash() { }
Original file line number Diff line number Diff line change @@ -695,6 +695,11 @@ public void Prepend(IEnumerable<Envelope> envelopes)
695
695
{
696
696
_userStash . Prepend ( envelopes ) ;
697
697
}
698
+
699
+ public int Count => _userStash . Count ;
700
+ public bool IsEmpty => _userStash . IsEmpty ;
701
+ public bool NonEmpty => _userStash . NonEmpty ;
702
+ public bool IsFull => _userStash . IsFull ;
698
703
}
699
704
}
700
705
}
Original file line number Diff line number Diff line change @@ -43,14 +43,37 @@ public interface IStash
43
43
/// Returns all messages and clears the stash.
44
44
/// The stash is guaranteed to be empty afterwards.
45
45
/// </summary>
46
- /// <returns>TBD </returns>
46
+ /// <returns>The previous stashed messages. </returns>
47
47
IEnumerable < Envelope > ClearStash ( ) ;
48
48
49
49
/// <summary>
50
- /// TBD
50
+ /// Prepend a set of envelopes to the front of the stash.
51
51
/// </summary>
52
52
/// <param name="envelopes">TBD</param>
53
53
void Prepend ( IEnumerable < Envelope > envelopes ) ;
54
+
55
+ /// <summary>
56
+ /// The number of messages currently inside the stash.
57
+ /// </summary>
58
+ public int Count { get ; }
59
+
60
+ /// <summary>
61
+ /// Returns <c>true</c> when <see cref="Count"/> is zero.
62
+ /// </summary>
63
+ public bool IsEmpty { get ; }
64
+
65
+ /// <summary>
66
+ /// Returns <c>true</c> when <see cref="Count"/> is greater than zero.
67
+ /// </summary>
68
+ public bool NonEmpty { get ; }
69
+
70
+ /// <summary>
71
+ /// When using a bounded stash, this returns <c>true</c> when the stash is full.
72
+ /// </summary>
73
+ /// <remarks>
74
+ /// Always returns <c>false</c> when using an unbounded stash.
75
+ /// </remarks>
76
+ public bool IsFull { get ; }
54
77
}
55
78
}
56
79
Original file line number Diff line number Diff line change @@ -189,6 +189,11 @@ public void Prepend(IEnumerable<Envelope> envelopes)
189
189
}
190
190
}
191
191
192
+ public int Count => _theStash . Count ;
193
+ public bool IsEmpty => Count == 0 ;
194
+ public bool NonEmpty => ! IsEmpty ;
195
+ public bool IsFull => _theStash . Count >= _capacity ;
196
+
192
197
/// <summary>
193
198
/// Enqueues <paramref name="msg"/> at the first position in the mailbox. If the message contained in
194
199
/// the envelope is a <see cref="Terminated"/> message, it will be ensured that it can be re-received
Original file line number Diff line number Diff line change 11
11
namespace Akka . Dispatch
12
12
{
13
13
/// <summary>
14
- /// TBD
14
+ /// Describes the message queue semantics of a mailbox.
15
15
/// </summary>
16
16
public interface ISemantics
17
17
{
You can’t perform that action at this time.
0 commit comments