Tamir Dresher is a software architect, consultant, and instructor who specializes in reactive systems and the Reactive Extensions (Rx) framework. The presentation discusses architectural concepts like responsiveness, resilience, and reactiveness that are important for distributed and reactive systems. It provides examples of using Rx and the actor model with Akka to build systems that can react to various stimuli like user input, failures, or messages in an elastic and resilient manner. The presentation encourages adopting reactive principles and reactive frameworks to build systems that can adequately respond to and recover from changes.
This was a talk from DDDSW on Akka.Net, the actor model, concurrency and reactive. It covered what they are as well as an example use case and the lessons learned when running in that use case.
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherTamir Dresher
These are the slides from my talk at the CodeMash 2017 conferenece: http://www.codemash.org/session/creating-a-responsive-application-using-reactive-extensions/
Code examples are located here: https://github.com/tamirdresher/FromZeroToTheActorModel
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Codemotion
The Actor model has been around for a while, but only the Reactive revolution is bringing it to trend. Find out how your application can benefit from Actors to achieve Resilience - the ability to spring back into shape from a failure state. Akka is a toolkit that brings Actors to the JVM - think Java or Scala - and that leverages on them to help you build concurrent, distributed and resilient applications.
Beyond Fault Tolerance with Actor ProgrammingFabio Tiriticco
Actor Programming is a software building approach that lets you can go beyond fault tolerance and achieve Resilience, which is the capacity of a system to self-heal and spring back into a fresh shape. First I'll introduce the difference between Reactive Programming and Reactive Systems, and then we'll go over a couple of implementation examples using Scala and Akka.
The coupled GitHub repository with the code is here: https://github.com/ticofab/ActorDemo
This was a talk from DDDSW on Akka.Net, the actor model, concurrency and reactive. It covered what they are as well as an example use case and the lessons learned when running in that use case.
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherTamir Dresher
These are the slides from my talk at the CodeMash 2017 conferenece: http://www.codemash.org/session/creating-a-responsive-application-using-reactive-extensions/
Code examples are located here: https://github.com/tamirdresher/FromZeroToTheActorModel
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Codemotion
The Actor model has been around for a while, but only the Reactive revolution is bringing it to trend. Find out how your application can benefit from Actors to achieve Resilience - the ability to spring back into shape from a failure state. Akka is a toolkit that brings Actors to the JVM - think Java or Scala - and that leverages on them to help you build concurrent, distributed and resilient applications.
Beyond Fault Tolerance with Actor ProgrammingFabio Tiriticco
Actor Programming is a software building approach that lets you can go beyond fault tolerance and achieve Resilience, which is the capacity of a system to self-heal and spring back into a fresh shape. First I'll introduce the difference between Reactive Programming and Reactive Systems, and then we'll go over a couple of implementation examples using Scala and Akka.
The coupled GitHub repository with the code is here: https://github.com/ticofab/ActorDemo
The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators. Here is an overview of Rx with examples at the end.
CQRS (Command Query Responsibility Segregation) was all the hype in .NET architecture circles a few years back. But has it faded away? Is it old news? I argue that it hasn't, and the concepts of CQRS are alive and well and probably more widely accepted and considered today than a few years ago. From event-driven systems to the Reactive Manifesto, the principles of CQRS are with us and impacting many different tools. In this session, we'll explore those CQRS principles and how they have manifested themselves in the architectures of choice today. You'll come away with a greater appreciation of CQRS and ideas on how to incorporate those principles in your applications today.
Reactive Programming, Traits and Principles. What is Reactive, where does it come from, and what is it good for? How does it differ from event driven programming? It only functional?
Don't Wait! Develop responsive applications with Java EE7 insteadErin Schnabel
A revision to a previous session: we explore how the async mechanisms in Java EE7 help you be more responsive in the backend. Includes an overview of how EE7 technologies enable RxJava to be used in a container-friendly way.
Patterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, EuropeFlip Kromer
This talk centers on two things: a set of patterns for the architecture of high-scale data systems; and a framework for understanding the tradeoffs we make in designing them.
RxJava pour Android : présentation lors du GDG Android MontréalSidereo
Reactive extensions are a framework created by Microsoft for .NET at the end of 2009.
It is a «library that allows programmers to write succinct declarative code to orchestrate and coordinate asynchronous and event-based programs »
The way you write code with this library might be referred to as functional reactive programming, we’ll talk more about this during the presentation.
It is now available for Java and Android. The specifics for Android are helpers for thread and UI stuff.
Jake Wharton is a huge contributor for the Android version
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCKonrad Malawski
Intense 3 hour workshop covering Akka Actors, Cluster, Streams, HTTP and more. Including very advanced patterns.
Presented with Henrik Engstrom at O'Reilly Software Architecture Conference in New York City in 2017
Give your microservices a bus ride with MassTransitAlexey Zimarev
Microservices architecture is still a hot topic but many do not do it right. Challenges like cross-service dependencies, orchestration and load balancing require more and more bike-shedding instead of concentrating on the business capabilities. Using asynchronous messages, many of technical issues can be solved. Learn how to use advanced messaging patterns in your services.
Slides are from a workshop given at Progressive .NET Tutorials 2017. Repository is on Github: https://github.com/alexeyzimarev/ProgNet2017.MassTransit
The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators. Here is an overview of Rx with examples at the end.
CQRS (Command Query Responsibility Segregation) was all the hype in .NET architecture circles a few years back. But has it faded away? Is it old news? I argue that it hasn't, and the concepts of CQRS are alive and well and probably more widely accepted and considered today than a few years ago. From event-driven systems to the Reactive Manifesto, the principles of CQRS are with us and impacting many different tools. In this session, we'll explore those CQRS principles and how they have manifested themselves in the architectures of choice today. You'll come away with a greater appreciation of CQRS and ideas on how to incorporate those principles in your applications today.
Reactive Programming, Traits and Principles. What is Reactive, where does it come from, and what is it good for? How does it differ from event driven programming? It only functional?
Don't Wait! Develop responsive applications with Java EE7 insteadErin Schnabel
A revision to a previous session: we explore how the async mechanisms in Java EE7 help you be more responsive in the backend. Includes an overview of how EE7 technologies enable RxJava to be used in a container-friendly way.
Patterns of the Lambda Architecture -- 2015 April -- Hadoop Summit, EuropeFlip Kromer
This talk centers on two things: a set of patterns for the architecture of high-scale data systems; and a framework for understanding the tradeoffs we make in designing them.
RxJava pour Android : présentation lors du GDG Android MontréalSidereo
Reactive extensions are a framework created by Microsoft for .NET at the end of 2009.
It is a «library that allows programmers to write succinct declarative code to orchestrate and coordinate asynchronous and event-based programs »
The way you write code with this library might be referred to as functional reactive programming, we’ll talk more about this during the presentation.
It is now available for Java and Android. The specifics for Android are helpers for thread and UI stuff.
Jake Wharton is a huge contributor for the Android version
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCKonrad Malawski
Intense 3 hour workshop covering Akka Actors, Cluster, Streams, HTTP and more. Including very advanced patterns.
Presented with Henrik Engstrom at O'Reilly Software Architecture Conference in New York City in 2017
Give your microservices a bus ride with MassTransitAlexey Zimarev
Microservices architecture is still a hot topic but many do not do it right. Challenges like cross-service dependencies, orchestration and load balancing require more and more bike-shedding instead of concentrating on the business capabilities. Using asynchronous messages, many of technical issues can be solved. Learn how to use advanced messaging patterns in your services.
Slides are from a workshop given at Progressive .NET Tutorials 2017. Repository is on Github: https://github.com/alexeyzimarev/ProgNet2017.MassTransit
Similar to Reactiveness All The Way - SW Architecture 2015 Conference (20)
Tamir Dresher - What’s new in ASP.NET Core 6Tamir Dresher
ASP.NET Core is a modern Web framework for .NET that gives you everything you need to build powerful backend services.
With .NET 6 things are simpler than ever before and there are many new features that will make your development fun and fast.
In this session we'll explore all the cool and new things that were added and all that changes that make ASP.NET Core 6 the best web framework
Asynchronous processing of work is in the heart of any scalable system and interactive applications.
Over the years, the industry developed many techniques, frameworks and patterns to make it easier for developers to add the asynchronicity to their code and .NET was no exception.
However, most of the the innovation concetrated on a single work item and the concept of streams of data was given little attention.
With the new addition of IAsyncEnumerable and the System.Linq.Async and System.Interactive.Async librarirs things has finally changed.
In this lecture you will learn what asynchronous streams mean in C# and how you can leverage them to build complex asynchrounous pipelines inside your .NET applications.
Debugging tricks you wish you knew Tamir Dresher - Odessa 2019Tamir Dresher
My talk from the Odessa .NET User Group - http://www.usergroup.od.ua/2019/02/microsoft-net-user-group.html
Source can be found here: https://github.com/tamirdresher/DebuggingTricks
Do you know what developers do most of their day (except for surfing the internet)?
Writing code? WRONG!
They are debugging. The debugger is a powerful tool, but in this talk you'll learn tricks that will help find bugs in half the time and with less frustration. Because a happy developer is a productive developer.
I'll show you to use tools that will point to you to right direction and features didn't know that are even there, for both development time debugging and post-mortem production analysis.
From zero to hero with the actor model - Tamir Dresher - Odessa 2019Tamir Dresher
My talk from Odessa .NET User Group - http://www.usergroup.od.ua/2019/02/microsoft-net-user-group.html
Code can be found here: https://github.com/tamirdresher/FromZeroToTheActorModel
here's nothing new about the actor model, in fact it was invented in the early seventies. So how come its now the hottest buzzword? In this session you will learn what is the Actor Model and why it helps making your system Reactive - scalable, responsive and resilient. You will get to know Akka.Net library that makes the Actor model a piece of cake.
Tamir Dresher - Demystifying the Core of .NET CoreTamir Dresher
.NET Core has revolutionized the way we build applications. Today, you can write .NET code once and run it anywhere using the tools, practices, and techniques that .NET community known and loved for years. In this session, you'll learn about architecture of .NET Core and .NET Standard which allows it to run on any platform like Linux, OSX and windows. And you will explore how to integrate the different utilities, libraries and concepts to maximize your .NET skills in the new world of cross-platform .NET.
Video can be found here: https://www.youtube.com/watch?v=qOST2eCgo2I
Rx helps us solve many complex problems, such as combining different streams and reacting to events that involve timing aspects.
However, solving those problems with code is not really "done" unless you can validate and assure your results.
In this session you'll learn the Rx.NET testing utilities and patterns that makes testing Rx code not only easy but also a lot of fun
Building responsive application with Rx - confoo - tamir dresherTamir Dresher
Code examples can be found here: https://github.com/tamirdresher/Rx101
Reactive applications are designed to handle asynchronous events in a way that maximizes responsiveness, resiliency, and elasticity. Reactive Extensions (Rx) is a library that abstracts away the sources of events and provides tools to handle them in a reactive way.
With Rx, filtering events, composing event sources, transforming events, and dealing with errors all become much simpler than with traditional tools and paradigms.
.NET Debugging tricks you wish you knew tamir dresherTamir Dresher
Do you know what developers do most of their day (except for surfing the internet)?
Writing code? WRONG!
They are debugging. The debugger is a powerful tool, but in this talk you'll learn tricks that will help find bugs in half the time and with less frustration. Because a happy developer is a productive developer.
This session will show you tools that will point to you to right direction and features you didn't know that are even there.
Building responsive applications with Rx - CodeMash2017 - Tamir DresherTamir Dresher
Slides from the CodeMash 2017 conference: http://www.codemash.org/session/creating-a-responsive-application-using-reactive-extensions/
Code example are here: https://github.com/tamirdresher/Rx101
Cloud patterns - NDC Oslo 2016 - Tamir DresherTamir Dresher
Cloud computing provides amazing capabilities for the modern application, but there are many pitfalls to be aware of – scalability, resilience, elasticity, security and more.
In this session we will look at basic must-know patterns when architecting for the Azure cloud: Message-Oriented, Poison Messages, Cache, Priority Queues, Retry Patterns and more.
Rx 101 Codemotion Milan 2015 - Tamir DresherTamir Dresher
Slides from my talk about Reactive Extensions (Rx) fundamentals from Codemotion Milan 2015 conference. The demos and other samples can be found in the github repository: https://github.com/tamirdresher/Rx101
Leveraging Dependency Injection(DI) in Universal Applications - Tamir DresherTamir Dresher
Slides from my Mdevcon 2015 session:http://mdevcon.com/posts/2015/01/09/tamir-dresher/
Dependency injection is a software design pattern that implements inversion of control and allows a program design to follow the dependency inversion principle.
Join me in this session to see how we can leverage Dependency Injection(DI) to make our design Modular and Clean and FAST
Read more in my blog: www.tamirdresher.com
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
6. Resiliency
6
You know you have a distributed system when the crash of a
computer you’ve never heard of stops you from getting any
work done.
- Leslie Lamport -
11. Reacting to Changes (notifications) with Rx
• Observables
• Observers
• Operators
• www.ReactiveX.io
11
g(x)
f(x)
12. Rx Example
12
1. At least 4 characters
2. Don’t overflow server (0.5 sec delay)
3. Don’t send the same string again
4. Discard results if another search was requested
13. Rx Example
13
Rx.Observable.fromEvent($('#input'),'keyup')
.map(e => e.target.value)
.filter(text => text.length > 3)
.throttle(500 /* ms */)
.distinctUntilChanged()
.flatMapLatest(searchWikipedia)
.subscribe(
data => {
/* handle the results */},
error => {
/* handle any errors */});
Observable.FromEventPattern(txtBox,“TextChanged”)
.Select(_ => txtBox.Text);
.Where(txt => txt.Length > 3);
.Throttle(TimeSpan.FromSeconds(0.5))
.DistinctUntilChanged()
.Select(text => SearchAsync(text))
.Switch()
.Subscribe(
results => {
/* handle the results */ },
ex => {
/* handle any errors */ } );
RxJS Rx.NET
14. Back Pressure
14
3 per sec 1 per sec
http://www.reactive-streams.org/
Publisher Subscriber
demand
• “Push” behavior when consumer is
faster
• “Pull” behavior when producer is
faster
15. The Actor Model (Hewitt et al. 1973)
15
Alice
Mailbox
Bob
Sally
Mailbox
Mailbox
“the Actor model retained
more of what I thought
were the good features of
the object idea.”
Alan Kay
Object Orientation pioneer
and Smalltalk co-designer
Alice
Parent
Bob
Parent
Sally
Parent
16. Akka Example
16
class SimpleActor extends Actor {
override def receive: Receive = {
case x =>
println("Received message: " + x)
}
}
object Main extends App {
val system = ActorSystem(“actor-system")
val anActor: ActorRef =
system.actorOf(Props[SimpleActor])
anActor ! "Hello world"
} akka {
actor.deployment {
/simpleActor {
remote = "akka://actor-system@127.0.0.1:3232"
}
}
}
17. Akka Parental Supervision
17
override val supervisorStrategy =
OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) {
case _: ArithmeticException => Resume
case _: NullPointerException => Restart
case _: IllegalArgumentException => Stop
case _: Exception => Escalate
}
1. OneForOneStrategy – affect only the failing child
2. AllForOneStrategy – affects the failing child & it’s siblings
Child
Parent
Child
שמי תמיר דרשר, אני יועץ בחברת קוד ווליו שמלבד היותה חברת יעוץ במגוון נושאים וטכנולוגיות, היא גם מרכז הפיתוח של כלי הDebugging OzCode ו
כמו כן אני מרצה במרכז האקדמי רופין
אחד הbuzzwords שאנחנו שומעים יותר ויותר בשנים האחרונות הוא נושא ה Reactiveness של מערכות ושל אפליקציות ובשפות תכנות באופן כללי.
גם אותי זה נורא הלהיב, ובפרט הטכנולוגיה שנקראת
זה הלהיב אותי כל כך שכתבתי ספר בנושא Reactive Extensions in Action בהוצאת manning
קצת Self Promotion לא הזיק
אבל בוא נקח רגע צעד אחורה ונסתכל על האבולוציה של הארכיטקטורות שלנו
כמו כן אני מרצה במרכז האקדמי רופין
אחד הbuzzwords שאנחנו שומעים יותר ויותר בשנים האחרונות הוא נושא ה Reactiveness של מערכות ושל אפליקציות ובשפות תכנות באופן כללי.
גם אותי זה נורא הלהיב, ובפרט הטכנולוגיה שנקראת
זה הלהיב אותי כל כך שכתבתי ספר בנושא Reactive Extensions in Action בהוצאת manning
קצת Self Promotion לא הזיק
ארכיטקטורת תוכנה היא נורא דומה לפסטה
ואפשר לראות את ההתפתחות שלנו כתעשיה בוסג הפסטה שאנחנו משתמשים
בהתחלה כולנו כתבנו ספגטי קוד עם GOTO
ואז למדנו שאי אפשר אפילו להבין ולתחזק את מה שאנחנו כתבנו אז עברנו למודל הלזניה והתחלנו לכתוב הכל בשכבות
ואז ראינו שלהכין את הלזניה כחתיכה אחת זה לא מספיק טוב, בטח כשיש לנו המון סועדים ועדיף לנו לחלק אותה לחתיכות קטנות יותר
מה שיצר את מודל הרביולי – אותם microservices שהם הBUZZWORD שכולם נהנים להגיד
איך שלא יהיה, בסופו של דבר יש לנו משתמש שנמצא בקצה אחד שרוצה לקבל שירות, בין אם המשתמש אנושי או מערכת אחרת.
והמטרה הסופית שלנו כשעשינו את המערכת זה שהיא תדע להגיב
כמו כן אני מרצה במרכז האקדמי רופין
אחד הbuzzwords שאנחנו שומעים יותר ויותר בשנים האחרונות הוא נושא ה Reactiveness של מערכות ושל אפליקציות ובשפות תכנות באופן כללי.
גם אותי זה נורא הלהיב, ובפרט הטכנולוגיה שנקראת
זה הלהיב אותי כל כך שכתבתי ספר בנושא Reactive Extensions in Action בהוצאת manning
קצת Self Promotion לא הזיק
אבל בוא נקח רגע צעד אחורה ונסתכל על האבולוציה של הארכיטקטורות שלנו
המערכת שאתנחנו כותבים היום, יותר מתמיד, צריכות להגיב למסה הולכת וגדלה של אירועים ושל שינויים
מרכיבי מסך שמעלים אירועים
ועד לחיישנים שמזרימים לנו עדכונים
המערכת שלנו צריכה להגיב לכל זה, ולעשות את זה בזמן סביר
אחרת המשתמשים שלנו מתעצבנים ועוזבים
ההגדרה למה זה מערכות שהם reaectiv מפורט במסמך שנקרא reactive manifesto שפורסם בשנת 2014
ובעצם מסכם סדרה של עקרונות ומאייפינים למערכת שהיא ריאקטיבית
הדבר הראשון שאנחנו מגדירים במערכת שהיא ריאקטיבית הוא:
responsive
הדבר הראשון והחשוב ביותר הוא הצורך שלנו להגיב למשתמשים (בין אם הם אנושיים או שהם מערכות אחרות)
המערכת צריכה להגיב בזמן הגיוני לפניות שמתקבלות. אנחנו לא רוצים שהמערכת תעבור סף זמן מסוים לפני שהיא תחזיר תשובה
ואני מדבר פה על כל סוג של תשובה. גם להגיד תודה קיבלתי את הפניה זאת תשובה נהדרת
זה מה שנקרא להיות רספונסיבי וזה היעד שאנחנו מנסים להגיע אליו.
resilient
כמובן שעובדת החיים היא שתקלות ושגיאות קורות. זה לא שאנחנו רוצים את זה או מכוונים שזה מה שיקרה אבל אין מה לעשות זה יקרה.
ולכן המערכת שלנו צריכה לדעת להגיב לכשלונות (react to failures)
להגיב במובן הזה אומר לדעת להתמודד ולהתאושש. כיוון שאחרת לא יהיה לנו responsiveness
לדעת להיות resilient לא אומר שאנחנו מנסים לבנות מערכת מושלמת, כזו שאף פעם לא נכשלת. זה רק אומר שאנחנו צריכים לתכנן את המערכת כך שהיא תדע להתמודד עם כשלונות של החלקים שלה. זה אומר למשל לבנות את המערכת בצורה מחולקת כך שכשלון של חלק אחד לא ישפיע על חלק אחר. או לבנות את המערכת כך שחלקים מסוימים ישוכפלו ככה שאם אחד מהם קורס יש אחר שיקח את מקומו.
גישה הreactive מקובלת היא לנקוט במבנה של supervision כך שחלק אחד ינטר חלק אחר ויגיב כשהוא נכשל
Message driven
אם כל המאפיינים שדיברנו עליהם עד עכשיו הם היעדים שאנחנו רוצים מהמערכת
אז גישה מונחית הודעות היא ישום של איך אפשר להשיג אותם.
כשנעבוד בגישה כזו אנחנו אוטומטית הופכים את התקשורת של לאסינכרונית ולכן באופן מיידי עושים decoupling בין החלקים של המערכת גם במובן של ה-interfaces שהם חושפים וגם מבחינת הזמן
הרבה יותר קל לנו לעשות שינויים במבנה המערכת כך שיחידה מסוימת תטפל בהודעה מסוימת או תעשה לה ראוטינג. והרבה יותר קל לשנות את הpriority והסדר של הטיפול בהודעות. כל רכיב במערכת בוחר איך להגיב להודעות בצורה שונה.
הודעה מסוימת יכולה להיות הטריגר שלנו לעשות שינוי על כמות הnodes שאנחנו מרימים כדי לטפל בבקשות הבאות. כך שמערכת מגיבה בצורה דינמית ויחד עם האלסטיות אנחנו זוכים למערכת נושמת שמותאמת לצרכים האמיתיים בשטח.
ה-decoupling שאנחנו מקבלים בעבודה מבוססת הודעות כך שאין תלות בclient מסוים על מי יטפל בבקשה מאפשר לנו לשלוט בlatency
כל החלקים יחד
בסופו של דבר כל המרכיבים מתחברים ביחד. כדי להשיג רספונסיביות אנחנו צריכים שהמערכת תהיה resilience.
כדי שנשיג reslieincy אננו רוצים מימד של בקרה על התקשורות ועל הנפילות של החלקים השונים בלי לאבד את הבקשות בדרך. וזה מתקבל על ידי התקשורת שמבוססת על הודעות. כמו כן, ההודעות שמתקבלות מחזקות את היכולת של המערכת להיות רספונסיבית כי קבלת ההודעה לא אומר טיפול בה ולכן תגובה מיידית על קבלת ההודעה עושה את המערכת רספונסיבית.
על בסיס ההודעות הללו אנחנו יכולים להשיג אלסטיות שמשנה את מבנה המערכת בסיס כמות ההודעות שיש והמשמעות הספציפית לכל אחת. וכמובן ברגע שהערכת אלסטית אנחנו משיגים resiliency
elastic
ככל שהזמן חולף ככה המערכת שלנו תיחשף לעומסים שונים
אני מקווה בשביל כולכם שהעומס על המערכת שלכם רק יגדל, אבל עומס יכול לגדול בתקופה מסוימת ולרדת בתקופה אחרת
כדי להיות responsive ו-resilient המערכת חייבת להיות גמישה. כשהעומס עולה נוסיף Nodes או שנעלה את ה-scale של Nodes אחרים.
בסופו של דבר כל המרכיבים מתחברים ביחד. כדי להשיג רספונסיביות אנחנו צריכים שהמערכת תהיה resilience.
כדי שנשיג reslieincy אננו רוצים מימד של בקרה על התקשורות ועל הנפילות של החלקים השונים בלי לאבד את הבקשות בדרך. וזה מתקבל על ידי התקשורת שמבוססת על הודעות. כמו כן, ההודעות שמתקבלות מחזקות את היכולת של המערכת להיות רספונסיבית כי קבלת ההודעה לא אומר טיפול בה ולכן תגובה מיידית על קבלת ההודעה עושה את המערכת רספונסיבית.
על בסיס ההודעות הללו אנחנו יכולים להשיג אלסטיות שמשנה את מבנה המערכת בסיס כמות ההודעות שיש והמשמעות הספציפית לכל אחת. וכמובן ברגע שהערכת אלסטית אנחנו משיגים resiliency
הרכיבים במערכת שלנו צריכים לדעת עכשיו להגיב להודעות שמתקבלות
אצל חלק מהרכיבים, למשל הclients שלנו, צריכים להגיב לשינויים שקורים והם לא בהכרח הודעות, למשל תגובה לסנסורים או להקלדות של משתמש – או בקצרה שינוים.
זה דורש מאתנו מודל של תגובה לשינויים ואבטסטרקציה על מקור השינויים. בין המקור הוא queue שאנחנו קוראים ממנו הודעות או תיבת טקסט על המסך.
אנחנו צריכים מודל שגם יודע להסתכל על אוסף המקורות הללו ועל איך מטפלים במקרים שהם תלויים אחד בשני, או קורים ביחד.
בטרמינולוגיה של Rx מקור של הודעות או שינויים נקראה observable
והצרכן של השינויים נקרא observer
בין שניהם יכולים לבוא אוסף של אופרטורים שמאפשרים להגדיר טרנספורמציות, קומבינציות, פילטורים, אגרגציות ושליטה באורך החיים של הקשר. כך שאפשר לקבל complex event processing
היופי בRx שהטרימינלוגיה והסגנון הוא פורטבילי ולא משהו שספציפי רק לשפה אחת – יש לנו Rx לJAVA ל-C++ C# Swift וזה נראה כמעט אותו דבר
כך נראת דוגמא בJS וב-C#
בשתי הדוגמאות אנחנו הופכים תיבת טקסט לobservable עבור כל שינוי טקסט
לוקחים את הערך של הטקסט
אם הוא ארוך משלושה תוים
ואם עבר זמן של חצי שניה מההקלדה האחרונה
ואם ערך הטקסט שונה מהטקסט שכבר קיבלנו עבורו תוצאות בפעם האחרונה
אנחנו מבצעים חיפוש על פי הטקסט בצורה אסינכרונית
ודואגים שאם הטקסט שונה בזמן שממתינים לתוצאות של החיפודש הקודם אחנו נזרוק את התוצאות שיגיעו ונחכה לתוצאות של הטקסט החדש
בסופו של דבר הobserver שלנו מקבל תוצאות אם שגיאות ויכול להציג אותן על המסך או לעבד אותן
המודל של הObservable והobserver עובד מאוד טוב אבל אחת הבעיות היא שאם הקצב של הObservable גבוה מהקצב של הobserver אנחנו מגיעים למצב של backpresuure , נוצר לנו עומס שדוחף אחורה,
כדי לנסות לתת מענה נוצר הspec של reactive streams שבעצם מוסיף לפרוטוקול בין הobservable ל-observer אפשרות לobserver להודיע לobservable שהוא עמוס ולסמן לו מתי הוא פנוי לקבל עוד נוטיפיקציות
Rx לכשעצמו עדיין לא עובד לפי הreactive streams.
מודל נוסף שמקיים את הדרישות של ארכיטקטורה שהיא reactive הוא הActor model
הוצג ע"י Carl Hewitt ב1973
Resume the subordinate, keeping its accumulated internal state
Restart the subordinate, clearing out its accumulated internal state
Stop the subordinate permanently
Escalate the failure, thereby failing itself