CDPotion.Domain.BackgroundService (cdpotion v0.1.4)

Summary

Types

description not provided :(

A key-value pair for additional event information to pass along.

The Background Service that will be associated with the commands/events. Every Background Service operates independently, but they share the same API.

Functions

Clears all stored data for the service.

Set the recording state for the service.

Enables event updates for the service.

Disables event updates for the service.

Types

Link to this type

background_service_event()

@type background_service_event() :: %{
  eventMetadata: [event_metadata()],
  eventName: String.t(),
  instanceId: String.t(),
  origin: String.t(),
  service: service_name(),
  serviceWorkerRegistrationId: CDPotion.Domain.ServiceWorker.registration_id(),
  storageKey: String.t(),
  timestamp: CDPotion.Domain.Network.time_since_epoch()
}

description not provided :(

Link to this type

event_metadata()

@type event_metadata() :: %{key: String.t(), value: String.t()}

A key-value pair for additional event information to pass along.

Link to this type

service_name()

@type service_name() ::
  :backgroundFetch
  | :backgroundSync
  | :pushMessaging
  | :notifications
  | :paymentHandler
  | :periodicBackgroundSync

The Background Service that will be associated with the commands/events. Every Background Service operates independently, but they share the same API.

Functions

Link to this function

clear_events(service)

@spec clear_events(service_name()) :: {String.t(), map()}

Clears all stored data for the service.

Parameters:

  • (Required) service: description not provided :(
Link to this function

set_recording(should_record, service)

@spec set_recording(boolean(), service_name()) :: {String.t(), map()}

Set the recording state for the service.

Parameters:

  • (Required) should_record: description not provided :(
  • (Required) service: description not provided :(
Link to this function

start_observing(service)

@spec start_observing(service_name()) :: {String.t(), map()}

Enables event updates for the service.

Parameters:

  • (Required) service: description not provided :(
Link to this function

stop_observing(service)

@spec stop_observing(service_name()) :: {String.t(), map()}

Disables event updates for the service.

Parameters:

  • (Required) service: description not provided :(