f# - Event and Observable in FSharp -
Is it equivalent to doing this job
- On this
- Or with an overview on an event's property
seems functionally similar, and I think the difference is 'meaning':
- Are we considering this as an inactive source, from which a stream has come to us
Is this the right thinking? The main difference between <
incident and
observable is how do they handle the state and the United Nations?
subscription
-
The Events function are attached to the source event and you do not give a way to unsubscribe. If you use stateless combinations (such as
Event.scan ) and then attach many supervisors to the resultant event, they all will see the same status.
Inspectable function creates the "specification" of the processing pipeline when you attach a handler to the
IObservable value , You can get a
IDisposable back which can be used to remove all the handlers, each handler connected to
IObservable will receive a new state ( Because making a new processing series according to the runtime "specification" ).
In practice, the main difference is in statfullness - if you want to share the state, you can use the
Event module - It is possible to implement it by using
Observable but difficult.
If you are using Events inside
async , you should use
Observable and
AwaitObservable ( Built-in
), because the event combination will leak memory - this will attach the event handlers that are never deleted.
-
Comments
Post a Comment