Playwright.Channel.Catalog (playwright v0.1.17-preview-7) View Source
Provides storage and management of ChannelOwner instances.
Catalog implements GenServer to maintain state, while domain logic is
expected to be handled within caller modules such as Playwright.Channel.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Retrieves a resource from the Catalog by its param: guid.
Returns a List of resources matching the provided "filter".
Adds a resource to the Catalog, keyed on :guid.
Removes a resource from the Catalog, along with its legacy.
Starts a Playwright.Channel.Catalog linked to the current process with the
given "root" resource.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Specs
Retrieves a resource from the Catalog by its param: guid.
If the resource is already present in the Catalog that resource is returned
directly. The desired resource might not yet be in the Catalog, in which
case the request will be considered as "awaiting". An awaiting request will
later receive a response, when the Catalog entry is made, or will time out.
Returns
resource{:error, error}
Arguments
| key/name | type | description | |
|---|---|---|---|
catalog | param | pid() | PID for the Catalog server |
guid | param | binary() | GUID to look up |
:timeout | option | float() | Maximum time to wait, in milliseconds. Defaults to 30_000 (30 seconds). |
Specs
Returns a List of resources matching the provided "filter".
Returns
- [
resource] - []
Arguments
| key/name | type | description | |
|---|---|---|---|
catalog | param | pid() | PID for the Catalog server |
filter | param | map() | Attributes for filtering |
Specs
Adds a resource to the Catalog, keyed on :guid.
Returns
resource(the same as provided)
Arguments
| key/name | type | description | |
|---|---|---|---|
catalog | param | pid() | PID for the Catalog server |
resource | param | struct() | The resource to store |
Specs
Removes a resource from the Catalog, along with its legacy.
Returns
:ok
Arguments
| key/name | type | description | |
|---|---|---|---|
catalog | param | pid() | PID for the Catalog server |
guid | param | binary() | GUID for the "parent" |
Specs
Starts a Playwright.Channel.Catalog linked to the current process with the
given "root" resource.
Return Values
If the Catalog is successfully created and initialized, the function
returns {:ok, pid}, where pid is the PID of the running Catalog server.
Arguments
| key/name | type | description | |
|---|---|---|---|
root | param | map() | The root resource for items in the Catalog. Provides the Session for its descendants |