From: Koichi Sasada Date: 2018-02-21T17:23:13+09:00 Subject: [ruby-core:85727] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid On 2018/02/21 17:07, Eric Wong wrote: >> Or `Thread.create(keyword_args...)` ? (`.create` is an example name). > > One problem with a singleton method in "Thread" is separating args > intended for Thread creation vs args for block. We have the > same problem for Thread.new, too. > > Maybe Thread::Attr can be used like Struct: > > ``` > Thread::Attr.new(type: :coop, ...).new(_a) do |a| > ... > end > > > class MyActor < Thread::Attr.new(type: :coop) > ... > end > MyActor.new(_a) { |a| ... } > ``` We have discussed similar ideas. https://bugs.ruby-lang.org/issues/3187#note-8 https://bugs.ruby-lang.org/issues/6694 (and maybe we can find other related tickets) `Attr` is new naming idea and we need to discuss about it. > Yes, garbage from kwargs still annoys me; but that's a separate > problem which I hope can be fixed sooner. Just now I'm working on it (to present at OkinawaRubyKaigi02, Japan regional Ruby conference. This is Event-Driven-Development). -- // SASADA Koichi at atdot dot net Unsubscribe: