<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Concurrency on Ocarina — manual</title>
    <link>https://mojo-molotov.github.io/from-ocarina-to-igor/tags/concurrency/</link>
    <description>Recent content in Concurrency on Ocarina — manual</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <lastBuildDate>Mon, 01 Jun 2026 19:27:53 +0200</lastBuildDate>
    <atom:link href="https://mojo-molotov.github.io/from-ocarina-to-igor/tags/concurrency/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>02.10.06 — The Playwright actor: one owner thread</title>
      <link>https://mojo-molotov.github.io/from-ocarina-to-igor/02-ocarina/10-infra/06-playwright-actor/</link>
      <pubDate>Mon, 01 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://mojo-molotov.github.io/from-ocarina-to-igor/02-ocarina/10-infra/06-playwright-actor/</guid>
      <description>&lt;h1 id=&#34;021006the-playwright-actor-one-owner-thread&#34;&gt;02.10.06 — The Playwright actor: one owner thread&lt;a class=&#34;anchor&#34; href=&#34;#021006the-playwright-actor-one-owner-thread&#34; data-pagefind-ignore=&#34;all&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;blockquote class=&#39;book-hint &#39;&gt;&#xA;&lt;p&gt;Source folder: &lt;a href=&#34;https://github.com/mojo-molotov/ocarina/tree/main/src/ocarina/infra/playwright&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;src/ocarina/infra/playwright/&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The Playwright adapter mirrors the Selenium one file for file (&lt;code&gt;create_driver&lt;/code&gt;, &lt;code&gt;create_drivers_pool&lt;/code&gt;, &lt;code&gt;create_screenshotter&lt;/code&gt;, &lt;code&gt;driver_healthcheck&lt;/code&gt;, &lt;code&gt;mixins&lt;/code&gt;), with &lt;strong&gt;one extra file&lt;/strong&gt;: &lt;a href=&#34;https://github.com/mojo-molotov/ocarina/blob/main/src/ocarina/infra/playwright/driver.py&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;driver.py&lt;/code&gt;&lt;/a&gt;. That file deserves a chapter of its own. It is what reconciles Playwright&amp;rsquo;s &lt;em&gt;sync&lt;/em&gt; API — inherently bound to one thread — with Ocarina&amp;rsquo;s threaded model (pool, warmup, Watcher). The model has been stressed and stabilized; it holds.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;h2 id=&#34;the-problem-playwrights-sync-api-is-thread-affine&#34;&gt;The problem: Playwright&amp;rsquo;s sync API is thread-affine&lt;a class=&#34;anchor&#34; href=&#34;#the-problem-playwrights-sync-api-is-thread-affine&#34; data-pagefind-ignore=&#34;all&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Playwright&amp;rsquo;s &lt;strong&gt;sync&lt;/strong&gt; API binds every object it hands out — &lt;code&gt;Playwright&lt;/code&gt;, &lt;code&gt;Browser&lt;/code&gt;, &lt;code&gt;BrowserContext&lt;/code&gt;, &lt;code&gt;Page&lt;/code&gt;, &lt;code&gt;Locator&lt;/code&gt;, … — to the thread that called &lt;code&gt;sync_playwright().start()&lt;/code&gt;. Under the hood it is a &lt;em&gt;greenlet&lt;/em&gt; pinned to that thread. Touching any of them from another thread raises:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
