OpenFeature.Provider.Flagd.GRPC.EventStream (OpenFeature Flagd v0.1.0)
View SourceHandles gRPC event streaming for the Flagd provider.
This module listens for lifecycle events from flagd
(such as provider_ready
and
configuration_change
) and emits them via OpenFeature.EventEmitter
.
This module is a GenServer
and should be added to your supervision tree.
Static Supervision Example
# In your Application module
client = OpenFeature.get_client("gRPC")
children = [
{OpenFeature.Provider.Flagd.GRPC.EventStream, client}
]
Supervisor.start_link(children, strategy: :one_for_one)
Dynamic Supervision Example
# In your Application module
children = [
{DynamicSupervisor, name: MyApp.EventStreamSupervisor, strategy: :one_for_one}
]
Supervisor.start_link(children, strategy: :one_for_one)
# Later at runtime
client = OpenFeature.get_client("gRPC")
DynamicSupervisor.start_child(MyApp.EventStreamSupervisor, {OpenFeature.Provider.Flagd.GRPC.EventStream, client})
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
@spec child_spec(OpenFeature.Client.t()) :: Supervisor.child_spec()
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec start_link(OpenFeature.Client.t()) :: GenServer.on_start()