Sha256: 8aac989e7b3a0d465405193005da30281bb3d0f70f80752c4d835d81d1322b78

Contents?: true

Size: 213 Bytes

Versions: 6

Compression:

Stored size: 213 Bytes

Contents

# frozen_string_literal: true

module Nonnative
  class DelaySocketPair < SocketPair
    def read(socket)
      duration = proxy.options.dig(:delay) || 2
      sleep duration

      super socket
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nonnative-1.29.0 lib/nonnative/delay_socket_pair.rb
nonnative-1.28.0 lib/nonnative/delay_socket_pair.rb
nonnative-1.27.0 lib/nonnative/delay_socket_pair.rb
nonnative-1.26.0 lib/nonnative/delay_socket_pair.rb
nonnative-1.25.0 lib/nonnative/delay_socket_pair.rb
nonnative-1.24.0 lib/nonnative/delay_socket_pair.rb