SlideShare a Scribd company logo
1
2
Капітан Тарас Шевчук, офіцер відділу розробки
Центру інновацій та розвитку оборонних
технологій Міністерства оборони України
Автор, техлід та розробник декількох веб-
модулів військової екосистеми Delta
Мобілізований в Сили Оброни України з 2022
року, до цього - web team leader у MyHeritage
3
4
5
Delta ❤️Effect.ts
Chapter I: Effect
6
The history of JS/TS computations 1995 JS was born
2005 AJAX
2009 Node.JS
2012
2013
2015
Promises/A+
RxJS
ES2015
2017 Observable
TC39 Stage 1
https://rxjs.dev/guide/observable
Challenge #1: No error types
8
9
Challenge #1: No error types
10
Challenge #2: Poor DI typing system
11
Challenge #2: Poor DI typing system
12
13
Actions
Task: create POST method for REST service
1.Encode request payload
2.Send the request
3.If failed, repeat 3 times
4.If a long timeout, failed off
5.Parse the response to a business entity
6.If any error occurs, send a log
14
ParseError
Errors
HTTPError
TimeoutException
ParseError
Task: create POST method for REST service
Actions
1.Encode request payload
2.Send the request
3.If failed, repeat 3 times
4.If a long timeout, failed off
5.Parse the response to a business entity
6.If any error occurs, send a log
15
Task: create POST method for REST service
ParseError
Errors
HTTPError
TimeoutException
Services
HTTPService
LogService
Actions
1.Encode request payload
2.Send the request
3.If failed, repeat 3 times
4.If a long timeout, failed off
5.Parse the response to a business entity
6.If any error occurs, send a log
ParseError
Encoding
HTTP
Request Parsing
Retrying Timeout
Logging
Blueprint-first development
17
18
1. Payload encoding
2. HTTP request
3. Retry policy
4. Timeout policy
5. Response decoding
6. Error logging
19
Challenge 1: Error handling
20
Challenge 1: Error handling
21
Challenge 2: Dependency injection
22
Challenge 2: Dependency injection
23
Error handling
Dependency injection
24
How to invoke Effect?
25
runFork creates Fiber
How to invoke Effect?
26
Chapter II: Fiber
27
28
Fiber - concept of task for cooperative multitasking
https://medium.com/traveloka-engineering/cooperative-vs-preemptive-a-quest-to-maximize-
concurrency-power-3b10c5a920fe
29
run Fiber 1
run Fiber 2
run Fiber 3
run Fiber 1
Event loop Fibers queue
#2 #3
#3 #1
#1
Effect3
.runFork(...)
Effect2
.runFork(...)
Effect1
.runFork(...)
Fiber - concept of task for cooperative multitasking
30
Example: run three fibers simultaneously
31
Example: text.txt
32
Chapter III: Schema
33
34
35
Encoded Data
Encoded Data Schema
37
Encoded Data Schema
38
1.validated
2.transformed*
3.narrow-typed
* - optionally
Encoded Data Schema
39
never
40
Sync:
Async:
Effect:
Three types of decoding
41
Epilogue
42
Schema
Data Types
Error
Management
Dependency
injection
Concurrency
Encoding Decoding
Type guards
Assertions
Arbitrary
Option
Chunk
Exit
Cause
DateTime
Exptected Errors
Unexpected Errors
Retrying policies
Error accumulation
Services
Layers
Runtimes
Fiber
Stream
Sink
Semaphore
Latch
43
Schema
Data Types
Error
Management
Dependency
injection
Concurrency
Encoding Decoding
Type guards
Assertions
Arbitrary
Option
Chunk
Exit
Cause
DateTime
Exptected Errors
Unexpected Errors
Retrying policies
Error accumulation
Services
Layers
Runtimes
Fiber
Stream
Sink
Semaphore
Effect.ts Core
Command
KeyValueStore
Terminal
FIleSystem
Effect.ts Platform
HTTP API/Client/Server
Socket
Worker
Latch
44
The End.
LobbyX (Center of Innovations)

More Related Content

PPTX
7 Micro-Metrics That Predict Production Outages in Performance Labs Webinar
PDF
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
PDF
Celery: The Distributed Task Queue
PDF
Mongodb intro-2-asbasdat-2018
PDF
Application Security Workshop
PDF
GREAT STEP 2. TDD & MockMVC
DOCX
Perf test Eng interview preparation
PDF
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
7 Micro-Metrics That Predict Production Outages in Performance Labs Webinar
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
Celery: The Distributed Task Queue
Mongodb intro-2-asbasdat-2018
Application Security Workshop
GREAT STEP 2. TDD & MockMVC
Perf test Eng interview preparation
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...

Similar to "Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts", Taras Shevchuk (20)

DOC
Shyam pcf
PDF
6 ways to hack your JavaScript application by Viktor Turskyi
PPTX
Top Java Performance Problems and Metrics To Check in Your Pipeline
PDF
java servlet and servlet programming
PDF
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
PPTX
Micro service architecture
PDF
Node.js Enterprise Middleware
PPT
When Web Services Go Bad
DOC
PPTX
Production debugging web applications
DOCX
Đề thi lý thuyết DWSJ Aptech
PPT
OGCE Overview for SciDAC 2009
PPTX
Top 5 things to know about sql azure for developers
PDF
3rd Generation Web Application Platforms
DOC
Mahesh - Resume - Paypal
PPTX
Karate for Complex Web-Service API Testing by Peter Thomas
PDF
Become a Performance Diagnostics Hero
PPT
Real-time Search at Yammer - By Aleksandrovsky Boris
PPT
Real Time Search at Yammer
PPT
Realtime search at Yammer
Shyam pcf
6 ways to hack your JavaScript application by Viktor Turskyi
Top Java Performance Problems and Metrics To Check in Your Pipeline
java servlet and servlet programming
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
Micro service architecture
Node.js Enterprise Middleware
When Web Services Go Bad
Production debugging web applications
Đề thi lý thuyết DWSJ Aptech
OGCE Overview for SciDAC 2009
Top 5 things to know about sql azure for developers
3rd Generation Web Application Platforms
Mahesh - Resume - Paypal
Karate for Complex Web-Service API Testing by Peter Thomas
Become a Performance Diagnostics Hero
Real-time Search at Yammer - By Aleksandrovsky Boris
Real Time Search at Yammer
Realtime search at Yammer
Ad

More from Fwdays (20)

PDF
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
PPTX
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
PPTX
"Як ми переписали Сільпо на Angular", Євген Русаков
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
PDF
"Validation and Observability of AI Agents", Oleksandr Denisyuk
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
PPTX
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
PPTX
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
PDF
"AI is already here. What will happen to your team (and your role) tomorrow?"...
PPTX
"Is it worth investing in AI in 2025?", Alexander Sharko
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
PDF
"Scaling in space and time with Temporal", Andriy Lupa .pdf
PPTX
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
PPTX
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
PPTX
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
PPTX
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
"Як ми переписали Сільпо на Angular", Євген Русаков
"AI Transformation: Directions and Challenges", Pavlo Shaternik
"Validation and Observability of AI Agents", Oleksandr Denisyuk
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
"AI is already here. What will happen to your team (and your role) tomorrow?"...
"Is it worth investing in AI in 2025?", Alexander Sharko
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Database isolation: how we deal with hundreds of direct connections to the d...
"Scaling in space and time with Temporal", Andriy Lupa .pdf
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation theory and applications.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Empathic Computing: Creating Shared Understanding
PDF
cuic standard and advanced reporting.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Cloud computing and distributed systems.
Encapsulation theory and applications.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
20250228 LYD VKU AI Blended-Learning.pptx
Network Security Unit 5.pdf for BCA BBA.
Empathic Computing: Creating Shared Understanding
cuic standard and advanced reporting.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A Presentation on Artificial Intelligence
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf

"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts", Taras Shevchuk