を使用しIQStreamable
て作成されたオブジェクトがあります。DefineObservable
Microsoft.ComplexEventProcessing.Application
Task.Run()
コードは正常に見えますが、渡された引数 from intoを使用するDefineObservable
と、例外が発生することがわかりません。
ただし、プロパティを内部のメソッドに渡さずに直接使用するとTask.Run()
、機能しました。
例外
An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.ComplexEventProcessing.Diagnostics.dll
Additional information: Cannot serialize value of type 'System.IObservable'1[ValueObjects.Price]'.
メソッド
private void Monitor(IObservable<Price> priceObservable)
{
const string applicationName = "RealtimeMonitoring";
Microsoft.ComplexEventProcessing.Application application = PriceObserver.Server.CreateApplication(applicationName);
IQStreamable<Price> sStreamable = application
//.DefineObservable<Price>(() => PriceRealtimeProvider.Instance.PriceObservable)
.DefineObservable<Price>(() => PriceObservable)
.ToPointStreamable( => PointEvent<Price>.CreateInsert(DateTime.Now, price), AdvanceTimeSettings.IncreasingStartTime);
var standingQuery = from p in streamable select price ;
var sink = application.DefineObserver(() => new PriceObserver());
using (standingQuery.Bind(sink).Run())
{
// some code...
}
}
呼び出し:
Task.Run(()=>Monitor(PriceRealtimeProvider.Instance.PriceObservable)
質問:
StreamInsight はオブザーバー オブジェクトをシリアル化しますか? なぜ?
違いは何ですか
これ
.DefineObservable<Price>(() => PriceObservable)
と
これ
DefineObservable<Price>(() => PriceRealtimeProvider.Instance.PriceObservable)
引数を使用すると問題が発生するのはなぜですか?