Back to Browse

RPC for Workers in TypeScript...? Effect-TS RPC

2.8K views
May 5, 2025
24:07

👉 Enroll to Practical Effect here: https://lucasbarake.com/ Buy me a coffee! https://buymeacoffee.com/lucasbarake Repository: https://github.com/lucas-barake/effect-monorepo 00:00:00 The Awkward Native Worker API 00:00:56 Native Worker Issues: Error Propagation & Async Patterns 00:02:03 Native Worker Issues: Type Safety & Concurrency 00:02:50 Demo Setup: Worker Pool & Actions 00:03:12 Demo: Running Tasks Off Main Thread 00:03:56 Demo: Concurrency with a Single Worker 00:04:32 Demo: Concurrency with Two Workers 00:05:11 Code Intro: Effect Ecosystem & Dependencies 00:06:40 Defining the RPC Contract with Schema 00:07:59 Contract Details: Tagged Errors & Payload Schema 00:09:39 Worker Implementation: Entry Point 00:10:16 Worker Implementation: Defining RPC Procedures 00:10:54 Worker Setup: Understanding Effect Layers 00:11:38 Worker Setup: Composing the RPC Server Layer 00:12:49 Worker Setup: Providing Handlers & Protocol 00:13:36 Worker Setup: Platform Runner & Serialization Layer 00:15:08 Worker Setup: Running the Layer via Browser Runtime 00:15:58 Main Thread: Setting up the RPC Client Layer 00:16:13 Main Thread: Configuring the Worker Pool (Size/Concurrency) 00:16:37 Main Thread: Providing Platform & Spawning Workers 00:17:25 Main Thread: Creating & Consuming the Client Service 00:19:42 Deep Dive: Worker Pool Size Explained 00:20:31 Deep Dive: Effect's Pool Primitive 00:20:51 Pool Mechanics: Acquire Function & `pool.get` 00:21:40 Pool Mechanics: Idle Checks, Waiting & Acquisition 00:22:31 Pool Mechanics: Resource Release via Scope Finalization 00:23:21 Recap: Size vs Concurrency & Benefits 00:23:58 Outro

Download

0 formats

No download links available.

RPC for Workers in TypeScript...? Effect-TS RPC | NatokHD