ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
@ 2022-08-29 10:20 byroot (Jean Boussier)
  2022-08-29 10:23 ` [ruby-core:109758] " byroot (Jean Boussier)
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: byroot (Jean Boussier) @ 2022-08-29 10:20 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been reported by byroot (Jean Boussier).

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:109758] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
@ 2022-08-29 10:23 ` byroot (Jean Boussier)
  2022-08-29 10:24 ` [ruby-core:109759] " Eregon (Benoit Daloze)
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: byroot (Jean Boussier) @ 2022-08-29 10:23 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by byroot (Jean Boussier).


Proposed patch: https://github.com/ruby/ruby/pull/6299

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-98996

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:109759] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
  2022-08-29 10:23 ` [ruby-core:109758] " byroot (Jean Boussier)
@ 2022-08-29 10:24 ` Eregon (Benoit Daloze)
  2022-08-30  0:08 ` [ruby-core:109778] " shyouhei (Shyouhei Urabe)
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Eregon (Benoit Daloze) @ 2022-08-29 10:24 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by Eregon (Benoit Daloze).


Sounds good :+1:

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-98997

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:109778] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
  2022-08-29 10:23 ` [ruby-core:109758] " byroot (Jean Boussier)
  2022-08-29 10:24 ` [ruby-core:109759] " Eregon (Benoit Daloze)
@ 2022-08-30  0:08 ` shyouhei (Shyouhei Urabe)
  2022-08-30  0:15 ` [ruby-core:109779] " byroot (Jean Boussier)
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: shyouhei (Shyouhei Urabe) @ 2022-08-30  0:08 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by shyouhei (Shyouhei Urabe).


+1 for avoiding exceptions but `nil` can be problematic?  Because a closed queue would also return `nil` for `pop`.  You cannot distinguish if a queue is closed or would just block.

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-99014

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:109779] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
                   ` (2 preceding siblings ...)
  2022-08-30  0:08 ` [ruby-core:109778] " shyouhei (Shyouhei Urabe)
@ 2022-08-30  0:15 ` byroot (Jean Boussier)
  2022-08-30  0:42 ` [ruby-core:109780] " jeremyevans0 (Jeremy Evans)
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: byroot (Jean Boussier) @ 2022-08-30  0:15 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by byroot (Jean Boussier).


> but nil can be problematic? 

This was discussed in #18774:

  - `#pop` on closed queue already returns `nil` with no exception. `Queue.new.tap(&:close).pop # => nil`
  - `nil` make sense because you can use it in a loop such as `while item = queue.pop`.
  - There's not really any other value that make sense.

Overall it's really not that complicated to handle the various cases in which nil is returned. I have an real world example here: https://github.com/Shopify/statsd-instrument/blob/0af8a1e2e74fc24d1de8088ee995940033c1fe42/lib/statsd/instrument/batched_udp_sink.rb#L111-L138.

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-99015

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:109780] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
                   ` (3 preceding siblings ...)
  2022-08-30  0:15 ` [ruby-core:109779] " byroot (Jean Boussier)
@ 2022-08-30  0:42 ` jeremyevans0 (Jeremy Evans)
  2022-08-30  8:36 ` [ruby-core:109786] " shyouhei (Shyouhei Urabe)
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jeremyevans0 (Jeremy Evans) @ 2022-08-30  0:42 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by jeremyevans0 (Jeremy Evans).


shyouhei (Shyouhei Urabe) wrote in #note-4:
> +1 for avoiding exceptions but `nil` can be problematic?  Because a closed queue would also return `nil` for `pop`.  You cannot distinguish if a queue is closed or would just block.

We could add another keyword argument for the exception value, and have that value returned instead of raising an exception (the keyword argument would default to `nil`).  I'm not sure if it's worth supporting that, but it is a simple approach.

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-99016

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:109786] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
                   ` (4 preceding siblings ...)
  2022-08-30  0:42 ` [ruby-core:109780] " jeremyevans0 (Jeremy Evans)
@ 2022-08-30  8:36 ` shyouhei (Shyouhei Urabe)
  2022-09-22  4:50 ` [ruby-core:109988] " ko1 (Koichi Sasada)
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: shyouhei (Shyouhei Urabe) @ 2022-08-30  8:36 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by shyouhei (Shyouhei Urabe).


I don't think people want to exit from a `while item = queue.pop` loop because the queue would block.  `for (;;) { if (errno != EAGAIN) break; ... }` is a C idiom (people often break from a loop on error, _except_ EAGAIN).

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-99022

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:109988] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
                   ` (5 preceding siblings ...)
  2022-08-30  8:36 ` [ruby-core:109786] " shyouhei (Shyouhei Urabe)
@ 2022-09-22  4:50 ` ko1 (Koichi Sasada)
  2022-09-22  6:46 ` [ruby-core:109990] " byroot (Jean Boussier)
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ko1 (Koichi Sasada) @ 2022-09-22  4:50 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by ko1 (Koichi Sasada).


`Queue#pop(timeout:0)` returns `nil`. Is it enough? (and forget optional nonblock argument)

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-99238

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:109990] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
                   ` (6 preceding siblings ...)
  2022-09-22  4:50 ` [ruby-core:109988] " ko1 (Koichi Sasada)
@ 2022-09-22  6:46 ` byroot (Jean Boussier)
  2022-10-06  6:47 ` [ruby-core:110199] " ko1 (Koichi Sasada)
  2022-10-06  6:49 ` [ruby-core:110200] " byroot (Jean Boussier)
  9 siblings, 0 replies; 11+ messages in thread
From: byroot (Jean Boussier) @ 2022-09-22  6:46 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by byroot (Jean Boussier).


> Is it enough?

Interesting, I never thought of that.

I think I can work with that, but then I think this behavior should be documented and speced.

Because `timeout: 0` in some APIs (not necessarily ruby) can mean no timeout.

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-99240

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:110199] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
                   ` (7 preceding siblings ...)
  2022-09-22  6:46 ` [ruby-core:109990] " byroot (Jean Boussier)
@ 2022-10-06  6:47 ` ko1 (Koichi Sasada)
  2022-10-06  6:49 ` [ruby-core:110200] " byroot (Jean Boussier)
  9 siblings, 0 replies; 11+ messages in thread
From: ko1 (Koichi Sasada) @ 2022-10-06  6:47 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by ko1 (Koichi Sasada).


> Because timeout: 0 in some APIs (not necessarily ruby) can mean no timeout.

Already the implementation do -> "Queue#pop(timeout:0) returns nil if Queue is empty" so no problem?

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-99481

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ruby-core:110200] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
  2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
                   ` (8 preceding siblings ...)
  2022-10-06  6:47 ` [ruby-core:110199] " ko1 (Koichi Sasada)
@ 2022-10-06  6:49 ` byroot (Jean Boussier)
  9 siblings, 0 replies; 11+ messages in thread
From: byroot (Jean Boussier) @ 2022-10-06  6:49 UTC (permalink / raw)
  To: ruby-core

Issue #18982 has been updated by byroot (Jean Boussier).


Works for me. I'll leave this ticket open until I add some more spec and documentation to the existing method.

----------------------------------------
Feature #18982: Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop
https://bugs.ruby-lang.org/issues/18982#change-99482

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
This replaces [Feature #18965]

Currently these methods raise in three occasions:

  - `ThreadError(queue empty)` for `#pop` in `nonblock=true` mode, and the operation would block.
  - `ThreadError(queue full)` for `SizedQueue#push` in `nonblock=true` mode, and the operation would block.
  - `ClosedQueueError` if trying to `#push` in a closed queue.

I see several reasons to prefer a `nil` return value.

- Queue is often used in conjunction with threads, so you have to be very careful not to rescue an unrelated `ThreadError`.
- Queue if often used for low level code, deep in the stack, so exceptions are costly.

I propose that passing `exception: false` would cause the method to return `nil` instead of raising in the three cases listed above.

The argument `exception: true` is consistent with various other methods such as `IO#read_nonblock(exception: false)`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-10-06  6:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29 10:20 [ruby-core:109756] [Ruby master Feature#18982] Add an `exception: false` argument for Queue#push, Queue#pop, SizedQueue#push and SizedQueue#pop byroot (Jean Boussier)
2022-08-29 10:23 ` [ruby-core:109758] " byroot (Jean Boussier)
2022-08-29 10:24 ` [ruby-core:109759] " Eregon (Benoit Daloze)
2022-08-30  0:08 ` [ruby-core:109778] " shyouhei (Shyouhei Urabe)
2022-08-30  0:15 ` [ruby-core:109779] " byroot (Jean Boussier)
2022-08-30  0:42 ` [ruby-core:109780] " jeremyevans0 (Jeremy Evans)
2022-08-30  8:36 ` [ruby-core:109786] " shyouhei (Shyouhei Urabe)
2022-09-22  4:50 ` [ruby-core:109988] " ko1 (Koichi Sasada)
2022-09-22  6:46 ` [ruby-core:109990] " byroot (Jean Boussier)
2022-10-06  6:47 ` [ruby-core:110199] " ko1 (Koichi Sasada)
2022-10-06  6:49 ` [ruby-core:110200] " byroot (Jean Boussier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).