Skip to content

Commit

Permalink
Better integration with OrleansDashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
yevhen committed Aug 9, 2017
1 parent ff7bdd7 commit 9d9242b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Source/Orleankka.Runtime/Core/ActorEndpoint.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ public Task Autorun()
return Task.CompletedTask;
}

[MessageArgumentAttribute]
public Task<object> Receive(object message)
{
KeepAlive();

return invoker.OnReceive(instance, message);
}

[MessageArgumentAttribute]
public Task ReceiveVoid(object message) => Receive(message);

[MessageArgumentAttribute]
public Task Notify(object message) => Receive(message);

async Task IRemindable.ReceiveReminder(string name, TickStatus status)
Expand Down
3 changes: 3 additions & 0 deletions Source/Orleankka.Runtime/Core/ActorEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@ public Task Autorun()
return Task.CompletedTask;
}

[MessageArgumentAttribute]
public Task<object> Receive(object message)
{
KeepAlive();

return invoker.OnReceive(instance, message);
}

[MessageArgumentAttribute]
public Task ReceiveVoid(object message) => Receive(message);

[MessageArgumentAttribute]
public Task Notify(object message) => Receive(message);

async Task IRemindable.ReceiveReminder(string name, TickStatus status)
Expand Down
1 change: 0 additions & 1 deletion Source/Orleankka.Runtime/Core/ActorTypeDeclaration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;

using Orleans.CodeGeneration;
using Orleans.Concurrency;
using Orleans.MultiCluster;
using Orleans.Placement;
Expand Down
11 changes: 11 additions & 0 deletions Source/Orleankka.Runtime/Core/DashboardIntegration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.Linq;

namespace Orleankka.Core
{
/// <summary>
/// FOR INTERNAL USE ONLY!
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class MessageArgumentAttribute : Attribute {}
}
3 changes: 3 additions & 0 deletions Source/Orleankka.Runtime/Core/StatefulActorEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,18 @@ public Task Autorun()
return Task.CompletedTask;
}

[MessageArgumentAttribute]
public Task<object> Receive(object message)
{
KeepAlive();

return invoker.OnReceive(instance, message);
}

[MessageArgumentAttribute]
public Task ReceiveVoid(object message) => Receive(message);

[MessageArgumentAttribute]
public Task Notify(object message) => Receive(message);

async Task IRemindable.ReceiveReminder(string name, TickStatus status)
Expand Down
1 change: 1 addition & 0 deletions Source/Orleankka.Runtime/Orleankka.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<Compile Include="Actor.cs" />
<Compile Include="Cluster\StreamProviderConfiguration.cs" />
<Compile Include="Core\IActorHost.cs" />
<Compile Include="Core\DashboardIntegration.cs" />
<Compile Include="Core\StatefulActorEndpoint.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down

0 comments on commit 9d9242b

Please sign in to comment.