AFDataCache.Subscribe Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Register an IObserver to receive AFDataPipeEvents that are a result of the internal
AFDataPipe used within the data cache for auto-monitored attributes.
Namespace: OSIsoft.AF.Data
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public IDisposable Subscribe( IObserver<AFDataPipeEvent> observer )
Public Function Subscribe ( observer As IObserver(Of AFDataPipeEvent) ) As IDisposable Dim instance As AFDataCache Dim observer As IObserver(Of AFDataPipeEvent) Dim returnValue As IDisposable returnValue = instance.Subscribe(observer)
public: IDisposable^ Subscribe( IObserver<AFDataPipeEvent^>^ observer )
member Subscribe : observer : IObserver<AFDataPipeEvent> -> IDisposable
Parameters
- observer
- Type: SystemIObserverAFDataPipeEvent
The object that is to receive AFDataPipeEvents for attributes being auto-monitored by the data cache.
Return Value
Type: IDisposableReturns an IDispoable interface for the object to unsubscribe itself from the manager.
Remarks
Registering an observer for the data cache allows new events that arrive from the data pipe to be channeled to the Observer.
The method will throw exception if the passed observer is null or it is already subscribed.