Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | List of all members
playwright.sync_api._generated.WebSocket Class Reference
Inheritance diagram for playwright.sync_api._generated.WebSocket:
Inheritance graph
[legend]
Collaboration diagram for playwright.sync_api._generated.WebSocket:
Collaboration graph
[legend]

Public Member Functions

None on (self, Literal["close"] event, typing.Callable[["WebSocket"], "None"] f)
 
None on (self, Literal["framereceived"] event, typing.Callable[["typing.Union[bytes, str]"], "None"] f)
 
None on (self, Literal["framesent"] event, typing.Callable[["typing.Union[bytes, str]"], "None"] f)
 
None on (self, Literal["socketerror"] event, typing.Callable[["str"], "None"] f)
 
None on (self, str event, typing.Callable[..., None] f)
 
None once (self, Literal["close"] event, typing.Callable[["WebSocket"], "None"] f)
 
None once (self, Literal["framereceived"] event, typing.Callable[["typing.Union[bytes, str]"], "None"] f)
 
None once (self, Literal["framesent"] event, typing.Callable[["typing.Union[bytes, str]"], "None"] f)
 
None once (self, Literal["socketerror"] event, typing.Callable[["str"], "None"] f)
 
None once (self, str event, typing.Callable[..., None] f)
 
str url (self)
 
EventContextManager expect_event (self, str event, typing.Optional[typing.Callable] predicate=None, *typing.Optional[float] timeout=None)
 
typing.Any wait_for_event (self, str event, typing.Optional[typing.Callable] predicate=None, *typing.Optional[float] timeout=None)
 
bool is_closed (self)
 
- Public Member Functions inherited from playwright._impl._sync_base.SyncBase
None __init__ (self, Any impl_obj)
 
str __str__ (self)
 
None remove_listener (self, Any event, Any f)
 
- Public Member Functions inherited from playwright._impl._impl_to_api_mapping.ImplWrapper
str __repr__ (self)
 

Additional Inherited Members

- Protected Member Functions inherited from playwright._impl._sync_base.SyncBase
Any _sync (self, Union[Coroutine[Any, Any, Any], Generator[Any, Any, Any]] coro)
 
Callable[..., None] _wrap_handler (self, Union[Callable[..., Any], Any] handler)
 
- Protected Attributes inherited from playwright._impl._sync_base.SyncBase
 _dispatcher_fiber
 
 _loop
 
- Protected Attributes inherited from playwright._impl._impl_to_api_mapping.ImplWrapper
 _impl_obj
 

Member Function Documentation

◆ expect_event()

EventContextManager playwright.sync_api._generated.WebSocket.expect_event (   self,
str  event,
typing.Optional[typing.Callable]   predicate = None,
*typing.Optional[float]   timeout = None 
)
WebSocket.expect_event

Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy
value. Will throw an error if the webSocket is closed before the event is fired. Returns the event data value.

Parameters
----------
event : str
    Event name, same one would pass into `webSocket.on(event)`.
predicate : Union[Callable, None]
    Receives the event data and resolves to truthy value when the waiting should resolve.
timeout : Union[float, None]
    Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The
    default value can be changed by using the `browser_context.set_default_timeout()`.

Returns
-------
EventContextManager

◆ is_closed()

bool playwright.sync_api._generated.WebSocket.is_closed (   self)
WebSocket.is_closed

Indicates that the web socket has been closed.

Returns
-------
bool

◆ on() [1/5]

None playwright.sync_api._generated.WebSocket.on (   self,
Literal["close"]  event,
typing.Callable[["WebSocket"], "None"]   f 
)
Fired when the websocket closes.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ on() [2/5]

None playwright.sync_api._generated.WebSocket.on (   self,
Literal["framereceived"]  event,
typing.Callable[["typing.Union[bytes, str]"], "None"]  f 
)
Fired when the websocket receives a frame.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ on() [3/5]

None playwright.sync_api._generated.WebSocket.on (   self,
Literal["framesent"]  event,
typing.Callable[["typing.Union[bytes, str]"], "None"]  f 
)
Fired when the websocket sends a frame.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ on() [4/5]

None playwright.sync_api._generated.WebSocket.on (   self,
Literal["socketerror"]  event,
typing.Callable[["str"], "None"]   f 
)
Fired when the websocket has an error.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ on() [5/5]

None playwright.sync_api._generated.WebSocket.on (   self,
str  event,
typing.Callable[..., None]  f 
)
Registers the function ``f`` to the event name ``event``.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ once() [1/5]

None playwright.sync_api._generated.WebSocket.once (   self,
Literal["close"]  event,
typing.Callable[["WebSocket"], "None"]   f 
)
Fired when the websocket closes.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ once() [2/5]

None playwright.sync_api._generated.WebSocket.once (   self,
Literal["framereceived"]  event,
typing.Callable[["typing.Union[bytes, str]"], "None"]  f 
)
Fired when the websocket receives a frame.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ once() [3/5]

None playwright.sync_api._generated.WebSocket.once (   self,
Literal["framesent"]  event,
typing.Callable[["typing.Union[bytes, str]"], "None"]  f 
)
Fired when the websocket sends a frame.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ once() [4/5]

None playwright.sync_api._generated.WebSocket.once (   self,
Literal["socketerror"]  event,
typing.Callable[["str"], "None"]   f 
)
Fired when the websocket has an error.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ once() [5/5]

None playwright.sync_api._generated.WebSocket.once (   self,
str  event,
typing.Callable[..., None]  f 
)
The same as ``self.on``, except that the listener is automatically
removed after being called.

Reimplemented from playwright._impl._sync_base.SyncBase.

◆ url()

str playwright.sync_api._generated.WebSocket.url (   self)
WebSocket.url

Contains the URL of the WebSocket.

Returns
-------
str

◆ wait_for_event()

typing.Any playwright.sync_api._generated.WebSocket.wait_for_event (   self,
str  event,
typing.Optional[typing.Callable]   predicate = None,
*typing.Optional[float]   timeout = None 
)
WebSocket.wait_for_event

**NOTE** In most cases, you should use `web_socket.expect_event()`.

Waits for given `event` to fire. If predicate is provided, it passes event's value into the `predicate` function
and waits for `predicate(event)` to return a truthy value. Will throw an error if the socket is closed before the
`event` is fired.

Parameters
----------
event : str
    Event name, same one typically passed into `*.on(event)`.
predicate : Union[Callable, None]
    Receives the event data and resolves to truthy value when the waiting should resolve.
timeout : Union[float, None]
    Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The
    default value can be changed by using the `browser_context.set_default_timeout()`.

Returns
-------
Any

The documentation for this class was generated from the following file: