Skip to content

Conversation

alexvaluyskiy
Copy link
Contributor

  • Fixed racing conditions in the tests
  • Removed dead code
  • Use C# 6
  • Added XML documentation

/// TBD
/// </summary>
/// <param name="payload">TBD</param>
/// <param name="sender">TBD</param>
public NonPersistentMessage(object payload, IActorRef sender)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal code should not contains TBD Xml comments

@@ -249,22 +248,6 @@ private void HandleDeleteMessagesTo(DeleteMessagesTo message)
}, _continuationOptions);
}

private void HandleReadHighestSequenceNr(ReadHighestSequenceNr message)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code

/// </summary>
/// <param name="context">TBD</param>
/// <param name="message">TBD</param>
public static void EnqueueMessageFirst(this IActorContext context, object message)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code

{
internal static class CollectionsExtensions
{
public static ImmutableArray<T> AddFirst<T>(this ImmutableArray<T> @this, T item)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emulated LinkedList

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked the performance? AFAIK LinkedList AddFirst operation is O(1). Using ImmutableArray is copying the whole array into new struct: implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this one is slower. But I'm using it only in unit tests

/// TBD
/// </summary>
[Serializable]
public sealed class ReadHighestSequenceNr : IJournalRequest, IEquatable<ReadHighestSequenceNr>
Copy link
Contributor Author

@alexvaluyskiy alexvaluyskiy Apr 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code from the pre-2.4 persistence

@@ -121,7 +123,7 @@ public override string ToString()

internal abstract class ExamplePersistentActor : NamedPersistentActor
{
protected LinkedList<object> Events = new LinkedList<object>();
protected ImmutableArray<object> Events = ImmutableArray<object>.Empty;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protection from the racing conditions

@Horusiath
Copy link
Contributor

Only one question left in comments. Beside that everything is fine.

/// <param name="destination">TBD</param>
/// <param name="message">TBD</param>
/// <param name="timestamp">TBD</param>
/// <param name="attempt">TBD</param>
public Delivery(ActorPath destination, object message, DateTime timestamp, int attempt)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one will be internal in the next version, no need to have TBD docs

@Horusiath Horusiath merged commit 4039f85 into akkadotnet:dev Apr 28, 2017
@alexvaluyskiy alexvaluyskiy deleted the persistencerefactoring branch July 19, 2017 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants