-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align MayInterleave callback signature with 2.x
- Loading branch information
Showing
9 changed files
with
55 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
|
||
using Orleans.CodeGeneration; | ||
using Orleans.Concurrency; | ||
|
||
namespace Orleankka | ||
{ | ||
public static class InvokeMethodRequestExtensions | ||
{ | ||
public static bool Message(this InvokeMethodRequest request, Func<object, bool> predicate) => | ||
predicate(request.Message()); | ||
|
||
public static object Message(this InvokeMethodRequest request) | ||
{ | ||
if (request?.Arguments == null) | ||
return null; | ||
|
||
var receiveMessage = request.Arguments.Length == 1; | ||
if (receiveMessage) | ||
return UnwrapImmutable(request.Arguments[0]); | ||
|
||
var streamMessage = request.Arguments.Length == 5; | ||
return streamMessage ? UnwrapImmutable(request.Arguments[2]) : null; | ||
} | ||
|
||
static object UnwrapImmutable(object item) => | ||
item is Immutable<object> immutable ? immutable.Value : item; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters