Class: OpenAI::Realtime::Transports::AsyncWebSocket::Socket Private

Inherits:
WebSocket::AsyncWebSocketTransport::Socket show all
Defined in:
lib/openai/helpers/realtime/transports/async_websocket.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Compatibility wrapper for the socket class yielded before the shared transport extraction.

Instance Method Summary collapse

Methods inherited from WebSocket::AsyncWebSocketTransport::Socket

#abort, #aborted?, #close, #closed?, #read, #write

Constructor Details

#initialize(connection, url:) ⇒ Socket

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Socket.



37
38
39
# File 'lib/openai/helpers/realtime/transports/async_websocket.rb', line 37

def initialize(connection, url:)
  super(connection, url: url, error_factory: ERROR_FACTORY)
end

Instance Method Details

#enable_no_status_recovery ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



42
43
44
45
# File 'lib/openai/helpers/realtime/transports/async_websocket.rb', line 42

def enable_no_status_recovery
  @connection.extend(RecoverNoStatusClose) if @connection.respond_to?(:receive_close)
  nil
end