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

AF SDK Reference

AFDataPipe.Subscribe Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFDataPipe.Subscribe Method
Register an IObserver for AFDataPipeEvent with the AFDataPipe. All the AFDataPipeEvents received by the data pipe will be sent to the IObserver.

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 AFDataPipe
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.

Return Value

Type: IDisposable
an IDispoable interface for the object to unsubscribe itself from the data pipe.

Remarks

The method will throw exception if the passed observer is null. Also, unlike IObservable, the data pipe will need the application to trigger pulling of events, it does not completely operate on push mechanism. Application has to call the GetObserverEvents method to start the event notification to the IObserver. Once the application registers an IObserver to the data pipe, the data pipe will not allow the application to get data with the GetUpdateEvents methods. All subsequent events will be passed through the IObservers to the application, triggering by the GetObserverEvents method.

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