<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Concurrence on Ocarina — précis</title>
    <link>https://mojo-molotov.github.io/from-ocarina-to-igor/fr/tags/concurrence/</link>
    <description>Recent content in Concurrence on Ocarina — précis</description>
    <generator>Hugo</generator>
    <language>fr-FR</language>
    <lastBuildDate>Mon, 01 Jun 2026 19:25:20 +0200</lastBuildDate>
    <atom:link href="https://mojo-molotov.github.io/from-ocarina-to-igor/fr/tags/concurrence/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>02.10.06 — L&#39;acteur Playwright : un thread propriétaire</title>
      <link>https://mojo-molotov.github.io/from-ocarina-to-igor/fr/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/fr/02-ocarina/10-infra/06-playwright-actor/</guid>
      <description>&lt;h1 id=&#34;021006lacteur-playwright-un-thread-propriétaire&#34;&gt;02.10.06 — L&amp;rsquo;acteur Playwright : un thread propriétaire&lt;a class=&#34;anchor&#34; href=&#34;#021006lacteur-playwright-un-thread-propri%c3%a9taire&#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;Dossier source : &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;L&amp;rsquo;adapter Playwright reprend la structure de l&amp;rsquo;adapter Selenium fichier pour fichier (&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;), avec &lt;strong&gt;un fichier en plus&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;. Ce fichier mérite un chapitre à lui seul. C&amp;rsquo;est lui qui réconcilie l&amp;rsquo;API &lt;em&gt;sync&lt;/em&gt; de Playwright, intrinsèquement liée à un thread, avec le modèle threadé d&amp;rsquo;Ocarina (pool, warmup, Watcher).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;h2 id=&#34;le-problème-lapi-sync-de-playwright-est-thread-affine&#34;&gt;Le problème : l&amp;rsquo;API sync de Playwright est thread-affine&lt;a class=&#34;anchor&#34; href=&#34;#le-probl%c3%a8me-lapi-sync-de-playwright-est-thread-affine&#34; data-pagefind-ignore=&#34;all&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;L&amp;rsquo;API &lt;strong&gt;sync&lt;/strong&gt; de Playwright lie chaque objet qu&amp;rsquo;elle renvoie (&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;, …) au thread qui a appelé &lt;code&gt;sync_playwright().start()&lt;/code&gt;. Sous le capot, c&amp;rsquo;est un &lt;em&gt;greenlet&lt;/em&gt; épinglé à ce thread. Y toucher depuis un autre thread lève :&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
