From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 6D6C01F44D for ; Sat, 17 Feb 2024 20:55:48 +0000 (UTC) Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 2E05382958; Sat, 17 Feb 2024 20:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1708203340; bh=JzsNoBJaY03rePnL38YifI6V+MNbHNmX7mHhh7th16U=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=aCMTG4aR8GcbY90anaPMuZeBaKApNhB4MhgVv0Z85CPinhotSGFBvCbJoB71n+/EL djnHMkkI+V7+5aZrFkuz0xEI+YW7lmKkAJy0zSm+7o/iUveKQitGqLP8AA4goEppod P8LxqDmHdegyIWIhk97UdxFMZfRjY1RNjwXI5ncY= Received: from wrqvtvtt.outbound-mail.sendgrid.net (wrqvtvtt.outbound-mail.sendgrid.net [149.72.120.119]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 3168B81EFB for ; Sat, 17 Feb 2024 20:55:37 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=rE+sw8r6; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=EVi1pv2eym9bP8DgO9HoZR/QyTs6rxYXSa9hCUhTyPA=; b=rE+sw8r6EimbS1NPxTq8pb5nA4kc5K7vhZ0IQwXyuoKzfG5r6dGKUe0Zx1Siczfv5qGX 4QJ4Ywi6GtIF58IgWzAE4M/8wh8uD81Pz+OQa+73U6kWhvD771E7rH2lnEGTmHTjk9abXs j8zqtcs5oaQHFCWgWAVAubnkQ0gGCBN+BFTc4y/TYNb0xgF24lo8SZDaw6Wc++tpqhlFL1 e+q49EEO7ixITcV4gbcrAhRvFP/6ov7Oo7RJ0QUIvwYYR8YdUIzRxO5wwddaG9LOwDan58 9PfnmsroXCXTA2vvQLl+NQ+MnUVeFn4zIPaVEAcsyoyg/dMfYgIE8R+mjymf0+bw== Received: by filterdrecv-58bfc74dd6-8dt6p with SMTP id filterdrecv-58bfc74dd6-8dt6p-1-65D11D48-3 2024-02-17 20:55:36.057707623 +0000 UTC m=+2011141.050561301 Received: from herokuapp.com (unknown) by geopod-ismtpd-35 (SG) with ESMTP id UOMskRXDQym3z1mNhqeyOg for ; Sat, 17 Feb 2024 20:55:35.986 +0000 (UTC) Date: Sat, 17 Feb 2024 20:55:36 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 20276 X-Redmine-Issue-Author: forthoney X-Redmine-Sender: forthoney X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 93383 X-SG-EID: =?us-ascii?Q?jBUhz5dHVsRmglvuc9n+7tg6xgYgtRGNSl8oA=2Fe3uRMXEjL8PqBCCRh+GSV5o2?= =?us-ascii?Q?QGUu46Tn6qPlXdH1BIf1zY4aAj=2FeT7dBD8vCBA2?= =?us-ascii?Q?NgcM=2FagzPY3DqNUS7xLWI5Ol3WiZRyVgTia9RYv?= =?us-ascii?Q?LocpQAp12OivNAh0xoXg3tEmroQJ6jAUvKoxply?= =?us-ascii?Q?imCjsS9p=2FQcOeB=2FskJW7IuAf4UbOzbgnOVIyppe?= =?us-ascii?Q?BEtuMiZdzREmpynCCmst3FrW7zPRIaP8jmusD5X?= =?us-ascii?Q?1gIOcNEpC=2FDf=2F8ZgEjG+A=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: YSJONIXFPHGR5Y6FYY73BNR2EGH3CO4J X-Message-ID-Hash: YSJONIXFPHGR5Y6FYY73BNR2EGH3CO4J X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:116827] [Ruby master Feature#20276] Introduce Fiber interfaces for Ractors List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "forthoney (Seong-Heon Jung) via ruby-core" Cc: "forthoney (Seong-Heon Jung)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20276 has been reported by forthoney (Seong-Heon Jung). ---------------------------------------- Feature #20276: Introduce Fiber interfaces for Ractors https://bugs.ruby-lang.org/issues/20276 * Author: forthoney (Seong-Heon Jung) * Status: Open * Priority: Normal ---------------------------------------- ## Motivation I am trying to build a web server with Ractors. The lifecycle for a request in the current implementation is 1. main ractor buffers request 2. main ractor sends request to worker ractor 3. worker ractor sends response to main ractor 4. main ractor writes response 5. repeat The main ractor utilizes the Async gem (specifically async-http) to handle connections concurrently, meaning each request is handled on a separate fiber. The issue I am running into is after I send a request to a worker ractor, I need to do a blocking wait until I receive a response. While I am waiting for the response, I cannot take any more connections. ## Solution If the fiber scheduler had a hook for `Ractor.receive` or `Ractor#take` (both of which are blocking), the main ractor can send the message, handle other connections while the worker processes the request. When the worker produces a message, it will then take the reqeust and write it in the socket. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/