Click or drag to resize
OSIsoft, LLC

PIDataPipeSubscribe Method

Register an IObserver for AFDataPipeEvent with the PIDataPipe. All the AFDataPipeEvents received by the data pipe will be sent to the IObserver.

Namespace:  OSIsoft.AF.PI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.8.440
Syntax
public IDisposable Subscribe(
	IObserver<AFDataPipeEvent> observer
)

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(Int32, Boolean) 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(Int32) method. All subsequent events will be passed through the IObservers to the application, triggering by the GetObserverEvents method.
Version Information

AFSDK

Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6
See Also
Enabling Operational Intelligence