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

AF SDK Reference

AFTimeBasedEventSource Class

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFTimeBasedEventSource Class
The AFTimeBasedEventSource is a base class that can be used for data references which do not natively support streaming events for an AFDataPipe but supports RecordedValues(AFTimeRange, AFBoundaryType, UOM, String, Boolean, Int32). AFTimeBasedEventSource periodically polls data from AFAttribute in the pipe and caches the result. When the GetUpdateEvents/GetObserverEvents of the pipe is called, AFTimeBasedEventSource extracts the events up to current time + EventHorizonOffset from its cache to be returned to the caller.

Inheritance Hierarchy

SystemObject
  OSIsoft.AF.DataAFTimeBasedEventSource

Namespace:  OSIsoft.AF.Data
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public class AFTimeBasedEventSource : IDisposable
Public Class AFTimeBasedEventSource
	Implements IDisposable

Dim instance As AFTimeBasedEventSource
public ref class AFTimeBasedEventSource : IDisposable
type AFTimeBasedEventSource =  
    class
        interface IDisposable
    end

The AFTimeBasedEventSource type exposes the following members.

Constructors

  NameDescription
Public method
AFTimeBasedEventSource
Creates a new event source

Methods

  NameDescription
Public method
Dispose
Cleans up resources
Public method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method
ToString
Returns a string that represents the current object.
(Inherited from Object.)

Remarks

Data Reference needs to provide a static method CreateDataPipe that returns an AFTimeBasedEventSource object. AFTimeBasedEventSource has the following virtual methods that the implementor can override: Dispose(bool), GetDataFromSource and ValidateStream. GetDataFromSource in the base class would enumerate through all the signup attributes and retrieve data into its cache. Implementor can override this method if there are more efficient way to retrieve data (like a list bulk call). After retrieved data for the AFAttributes, the GetDataFromSource method will need to call the protected PublishToCache method to save the result into AFTimeBasedEventSource's data cache. ValidateStream in the base class will check if the passed AFAttribute supports RecordedValues.

User of the AFTimeBasedEventSource can also adjust the data retrieval time span. Default time span is two minutes.

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

See Also

TitleResults for “How to create a CRG?”Also Available in