databay.inlet¶
See also
Extending Inlets to learn how to extend this class correctly.
Outlet
representing the corresponding output of the data stream.
-
class
databay.inlet.
Inlet
(metadata: dict = None)[source]¶ databay.inlet.Inlet
Abstract class representing an input of the data stream.
- Parameters
metadata (dict) – Global metadata that will be attached to each record generated by this inlet. It can be overridden or appended to by providing metadata when creating a record using
new_record()
function.Default:None
Bases:
abc.ABC
-
metadata
(self)[source]¶ property
Global metadata that will be attached to each record generated by this inlet. It can be overridden or appended to by providing metadata when creating a record using
new_record()
function.- Returns
Metadata dictionary.
- Return type
-
pull
(self, update: da.Update) → List[Record][source]¶ abstractmethod
Produce new data.
Override this method to define how this inlet will produce new data.
-
new_record
(self, payload, metadata: dict = None) → Record[source]¶ Create a new
Record
. This should be the preferred way of creating new records.
-
on_start
(self)[source]¶ Called once per inlet just before the governing planner is about to start.
Override this method to provide starting functionality on this inlet.
-
try_shutdown
(self)[source]¶ Wrapper around on_shutdown call that will ensure it only gets executed once.