Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFDataCache.Subscribe Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFDataCache.Subscribe Method
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: IDisposable
Returns 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.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in