View Source Playwright.SDK.Channel.Catalog (playwright v1.44.0-alpha.4)
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.SDK.Channel
.
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.SDK.Channel.Catalog
linked to the current process with the
given "root" resource.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
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). |
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 |
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 |
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" |
Starts a Playwright.SDK.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 |