|
1 | | -using System; |
2 | | -using System.Linq; |
3 | | -using System.Runtime.CompilerServices; |
4 | | -using System.Threading.Tasks; |
5 | | -using Microsoft.Extensions.DependencyInjection; |
| 1 | +using Microsoft.Extensions.DependencyInjection; |
6 | 2 | using Microsoft.Extensions.Logging; |
7 | 3 | using Orleans; |
| 4 | +using Orleans.Concurrency; |
8 | 5 | using Ray.Core.Configuration; |
9 | 6 | using Ray.Core.Event; |
10 | 7 | using Ray.Core.Exceptions; |
11 | 8 | using Ray.Core.Serialization; |
12 | 9 | using Ray.Core.Snapshot; |
13 | 10 | using Ray.Core.Storage; |
| 11 | +using System; |
| 12 | +using System.Linq; |
| 13 | +using System.Runtime.CompilerServices; |
| 14 | +using System.Threading.Tasks; |
14 | 15 |
|
15 | 16 | namespace Ray.Core |
16 | 17 | { |
@@ -76,7 +77,7 @@ protected async virtual ValueTask DependencyInjection() |
76 | 77 | await eventStorageTask; |
77 | 78 | EventStorage = eventStorageTask.Result; |
78 | 79 | //创建状态存储器 |
79 | | - var followConfigTask = configureBuilder.GetObserverConfig(ServiceProvider,GrainType, GrainId); |
| 80 | + var followConfigTask = configureBuilder.GetObserverConfig(ServiceProvider, GrainType, GrainId); |
80 | 81 | if (!followConfigTask.IsCompletedSuccessfully) |
81 | 82 | await followConfigTask; |
82 | 83 | var stateStorageTask = storageFactory.CreateObserverSnapshotStorage(followConfigTask.Result, GrainId); |
@@ -188,9 +189,9 @@ protected virtual ValueTask InitFirstSnapshot() |
188 | 189 | return Consts.ValueTaskDone; |
189 | 190 | } |
190 | 191 | #endregion |
191 | | - public Task OnNext(byte[] bytes) |
| 192 | + public Task OnNext(Immutable<byte[]> bytes) |
192 | 193 | { |
193 | | - var (success, transport) = EventBytesTransport.FromBytesWithNoId(bytes); |
| 194 | + var (success, transport) = EventBytesTransport.FromBytesWithNoId(bytes.Value); |
194 | 195 | if (success) |
195 | 196 | { |
196 | 197 | var data = Serializer.Deserialize(TypeContainer.GetType(transport.EventType), transport.EventBytes); |
|
0 commit comments