Skip to content

2.0.0 Beta 1

Pre-release
Pre-release
Compare
Choose a tag to compare
@trowski trowski released this 30 May 19:21
v2.0.0-beta.1
a852cda

Initial release compatible with AMPHP v3.

As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.

  • Removed the Options object. Settings that were set using properties on the Options object are now parameters to client factories in the websocket-client and websocket-server libraries or the HeartbeatQueue and RateLimiter interfaces
  • Added HeartbeatQueue and RateLimiter interfaces with implementations DefaultHeartbeatQueue and DefaultRateLimiter – these objects replace some of the functionality that was only contained within Rfc6455Client and controlled via Options
  • Opcode is now an enum
  • Added Websocket as a prefix to several classes:
    • Client renamed to WebsocketClient
    • ClientMetadata renamed to WebsocketClientMetadata
    • Message renamed to WebsocketMessage
  • WebsocketClient now extends Amp\Closable
    • isConnected() method replaced with isClosed()
  • WebsocketClient::receive() now supports cancellation. Cancelled receives do not discard a message, a subsequent call to receive() will still return the next message received from the client
  • Closures provided to WebsocketClient::onClose() are provided an instance of WebsocketClientMetadata instead of the client object, close code, and reason. The code and reason are available on the metadata object.