Sha256: 85b222dd04039d16a2a6a713b3736a817d96eb19e0947a9b38f49616bbd8f3a7
Contents?: true
Size: 551 Bytes
Versions: 21
Compression:
Stored size: 551 Bytes
Contents
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2018-2023, by Samuel Williams. # Copyright, 2020, by Bruno Sutic. # Copyright, 2023, by Thomas Morgan. require 'protocol/http/body/wrapper' module Async module HTTP module Body class Delayed < ::Protocol::HTTP::Body::Wrapper def initialize(body, delay = 0.01) super(body) @delay = delay end def ready? false end def read Async::Task.current.sleep(@delay) return super end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems