SlideShare a Scribd company logo
1 of 32
Download to read offline
Dive into SObjectizer-5.5
SObjectizer Team, Jan 2016
Seventh Part: Message Limits
(at v.5.5.15)
This is the next part of the series of presentations with deep
introduction into features of SObjectizer-5.5.
This part is dedicated to message limits feature.
This feature is intended to use in protection of agents from
overloading.
SObjectizer Team, Jan 2016
Introduction
SObjectizer Team, Jan 2016
The main way of interaction between agents in SObjectizer
is asynchronous messages.
It makes very easy to use “fire-and-forget” scheme:
● an agent A finishes its own part of work, sends the result as a
message to agent B and starts new processing;
● agent B receives a message, processes it and sends a new
message to agent C;
● agent C receives a message, processes it and sends…
This is very simple scheme but...
SObjectizer Team, Jan 2016
...what if some agent in this chain processes messages
much slower than the other agents which send new
messages to it?
This problem is known as overloading of agent.
SObjectizer Team, Jan 2016
Overloading leads to growth of event queues.
Event queues eat more and more memory.
Growing memory usage slows down the application.
Lower speed leads to faster growth of event queues…
As a result of overloading the application is degraded and
should be killed in most cases.
SObjectizer Team, Jan 2016
There is no simple solution for overloading problem because
a good overload control scheme for a particular application-
specific agent will be very domain-specific and, probably,
can’t be reused in another project.
So, there is no ready-to-use just out-of-box tool or
mechanism in SObjectizer which could be seen as ‘one size
fits all’ solution for overloading problem.
SObjectizer Team, Jan 2016
But there is a mechanism which can protect agents from
overloading in simple situations.
This mechanism is known as message limits.
SObjectizer Team, Jan 2016
Message limits is an optional feature which can be turned on
for individual agent.
If message limits is turned on for an agent SObjectizer will
count instances of messages in agent’s event queue.
When number of messages of particular type exceeds limit
for that type SObjectizer performs an overlimit reaction
which is specified by user.
SObjectizer Team, Jan 2016
Types Of Overlimit Reactions
SObjectizer Team, Jan 2016
There are several overlimit reactions which can be
performed by SObjectizer:
● dropping new messages;
● killing the whole application by std::abort();
● redirecting new messages to another mbox;
● transforming new messages to messages of different
types (with possibility to redirect them to different
mboxes).
SObjectizer Team, Jan 2016
Message dropping is the simplest form of overlimit reactions.
It means that a new message of type T which exceeds limit
for messages of type T will be ignored and will not be
pushed to event queue of the subscriber.
This type of reaction can be useful if there is an intensive
flow of messages and losing of several messages is not a
problem. For example: ignored message will be repeated by
sender after some timeout.
SObjectizer Team, Jan 2016
Another simple overlimit reaction is killing the whole
application by std::abort().
This overlimit reaction can be used in scenarios where the
application must guarantee some throughput but can’t do
that.
For example: an agent should process messages quite
quickly. But there is a bug in the agent’s implementation and
sometimes it fell into infinite loop. The only solution there is
killing the app and restart it.
SObjectizer Team, Jan 2016
The next overlimit reaction is redirection of a new message
to another mbox.
This type of reaction could be used in different schemes:
● a very simple load balancing with agents A1, A2, ..., An. Agent A1
redirects messages to A2. A2 redirects to A3 and so on;
● different kind of processing by different subscribers. There could
be agent N which does a normal processing. On overload it
redirects messages to agent P which just sends back a reply
“system is busy, try later”.
SObjectizer Team, Jan 2016
The last and most complex reaction is transformation with
optional redirection.
This type of reaction could be used in implementing complex
domain-specific schemes of overload control.
For example, an overloaded agent could transform new messages
into signals about overloaded state and sends it to an overload
controller. The controller can perform some actions like changing
processing params, disconnecting some clients, switching off some
logging and so on...
SObjectizer Team, Jan 2016
Maximum Overlimit Reaction Deep
SObjectizer Team, Jan 2016
There is a possibility of redirection loops for overlimit
reactions of ‘redirect’ and ‘transform’ types.
For example: agent A1 redirects message to A2, A2
redirects to A3, …, An redirects back to A1.
Without a control of recursion of overlimit reactions infinite
loops inside message delivery procedure could arise.
SObjectizer Team, Jan 2016
Because of that SObjectizer limits the number of overlimit
reactions which are performed during the delivery of a
message instance.
This is called ‘overlimit_deep’ and the current maximum
value of overlimit_deep is 16.
This value is hardcoded in the current SObjectizer
implementation and can’t be changed in run-time.
SObjectizer Team, Jan 2016
When maximum value of overlimit_deep is reached then a
delivery of message is aborted by raising so_5::exception_t
with the appropriate error code.
Please note that if it is a delivery via multi-consumer mbox
then some subscribers will not receive a message. Even if
they do not use message limits at all.
It is because the whole delivery procedure is canceled.
SObjectizer Team, Jan 2016
How To Specify Message Limits?
SObjectizer Team, Jan 2016
This part of presentation contains some examples of
message limits definition.
But before going deep into code samples some important
rules first...
SObjectizer Team, Jan 2016
If an agent defines message limit for some message type T it
must also define message limits for all other message types
it processes.
If an agent defines message limit for type T and tries to
make a subscription for message of type M which hasn’t
defined limit there will be an error.
SObjectizer Team, Jan 2016
Message limits are defined at the moment of agent’s
construction and can’t be changed or removed later.
Definition of message limits are passed to the constructor of
so_5::agent_t or to coop_t::define_agent() method via so_5::
context_t object.
SObjectizer Team, Jan 2016
Definition of message limits with ‘drop message’ overlimit
reaction could look like:
// For ordinary agents:
class request_processor : public so_5::agent_t {
public :
request_processor( context_t ctx )
: so_5::agent_t( ctx
// No more than 20 messages with dropping of extra messages.
+ limit_then_drop< request >( 20 )
// No more than 1 message with dropping of extra messages.
+ limit_then_drop< get_status >( 1 ) )
...
};
// For ad-hoc agents:
coop.define_agent( coop.make_agent_context()
+ so_5::agent_t::limit_then_drop< request >( 20 )
+ so_5::agent_t::limit_then_drop< get_status >( 1 ) )...
SObjectizer Team, Jan 2016
Definition of message limits with ‘abort the app’ overlimit
reaction could look like:
// For ordinary agents:
class hardware_interface : public so_5::agent_t {
public :
hardware_interface( context_t ctx )
: so_5::agent_t( ctx
// Usually there must be no more than 10 waiting commands.
// But if something goes wrong and hardware part doesn't respond
// it is better to terminate the whole application.
+ limit_then_abort< outgoing_apdu_command >( 500 ) )
...
};
// For ad-hoc agents:
coop.define_agent( coop.make_agent_context()
+ so_5::agent_t::limit_then_abort< outgoing_apdu_command >( 500 ) );
SObjectizer Team, Jan 2016
Definition of message limits with ‘redirect’ overlimit reaction
could look like:
class normal_request_processor : public so_5::agent_t
{
public :
normal_request_processor(
context_t ctx,
// Message box of agent for handling requests in overload mode.
// In this mode requests are not processed but negative response with the appropriate
// result code is sent back (and this fact is stored in the application log).
so_5::mbox_t overload_mode_processor )
: so_5::agent_t( ctx
// We can hold no more that 10 requests in queue.
// All extra messages must be redirected to overload-mode processor
// for generation of negative replies.
+ limit_then_redirect< request >( 10,
[overload_mode_processor] { return overload_mode_processor; } )
...
};
SObjectizer Team, Jan 2016
Definition of message limits with ‘transform’ overlimit
reaction could look like (for the case of a message):
class request_processor : public so_5::agent_t
{
public :
normal_request_processor( context_t ctx )
: so_5::agent_t( ctx
// We can hold no more that 10 requests in queue.
// For all extra messages negative replies must be generated.
+ limit_then_transform( 10, [](const request & evt) {
return make_transformed< negative_reply >(
// Mbox for sending reply is got from original request.
evt.reply_to(),
// All other arguments are passed to negative_reply constructor.
error_code::processor_is_busy );
} ) )
{}
...
};
SObjectizer Team, Jan 2016
Definition of message limits with ‘transform’ overlimit
reaction could look like (for the case of a signal):
class long_operation_performer : public so_5::agent_t
{
public :
long_operation_performer( context_t ctx, so_5::mbox_t mbox_for_notifications )
: so_5::agent_t( ctx
// If we cannot process previous get_status signal
// then we are busy and can tell about this.
+ limit_then_transform< get_status >( 1,
[this, mbox_for_notifications] {
// The result of the transformation is another signal and because of that
// there is only one argument for make_transform (the target mbox).
return make_transformed< status_busy >( notification_mbox );
} ) )
{}
...
};
SObjectizer Team, Jan 2016
Some Final Words
SObjectizer Team, Jan 2016
This presentation is just a short introduction in the topic of
message limits.
For more detailed information please see the corresponding
section of Project’s Wiki.
But it is necessary to remember that message limits is not a
fullfledged solution for overload problem...
SObjectizer Team, Jan 2016
Message limits could be seen as a basic building blocks for
more complex application- and domain-specific overload
control schemes.
Some examples of such schemes which are based on collector-
performer agents pairs are represented in several examples in the
SObjectizer’s distribution (they are also described in Project’s Wiki):
● work_generation;
● collector_performer_pair and collector_many_performers;
● simple_message_deadline;
● prio_work_stealing.
SObjectizer Team, Jan 2016
Additional Information:
Project’s home: http://sourceforge.net/projects/sobjectizer
Documentation: http://sourceforge.net/p/sobjectizer/wiki/
Forum: http://sourceforge.net/p/sobjectizer/discussion/
Google-group: https://groups.google.com/forum/#!forum/sobjectizer
GitHub mirror: https://github.com/masterspline/SObjectizer

More Related Content

What's hot

arataga. SObjectizer and RESTinio in action: a real-world example
arataga. SObjectizer and RESTinio in action: a real-world examplearataga. SObjectizer and RESTinio in action: a real-world example
arataga. SObjectizer and RESTinio in action: a real-world exampleYauheni Akhotnikau
 
Date Processing Attracts Bugs or 77 Defects in Qt 6
Date Processing Attracts Bugs or 77 Defects in Qt 6Date Processing Attracts Bugs or 77 Defects in Qt 6
Date Processing Attracts Bugs or 77 Defects in Qt 6Andrey Karpov
 
PVS-Studio vs Chromium. 3-rd Check
PVS-Studio vs Chromium. 3-rd CheckPVS-Studio vs Chromium. 3-rd Check
PVS-Studio vs Chromium. 3-rd CheckAndrey Karpov
 
Testing RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured frameworkTesting RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured frameworkMicha Kops
 
Analysis of bugs in Orchard CMS
Analysis of bugs in Orchard CMSAnalysis of bugs in Orchard CMS
Analysis of bugs in Orchard CMSPVS-Studio
 
Creating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationCreating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationMicha Kops
 
MQTT and Java - Client and Broker Examples
MQTT and Java - Client and Broker ExamplesMQTT and Java - Client and Broker Examples
MQTT and Java - Client and Broker ExamplesMicha Kops
 
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014First Tuesday Bergen
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desaijinaldesailive
 
Parallel Programming With Dot Net
Parallel Programming With Dot NetParallel Programming With Dot Net
Parallel Programming With Dot NetNeeraj Kaushik
 

What's hot (20)

What is SObjectizer 5.5
What is SObjectizer 5.5What is SObjectizer 5.5
What is SObjectizer 5.5
 
arataga. SObjectizer and RESTinio in action: a real-world example
arataga. SObjectizer and RESTinio in action: a real-world examplearataga. SObjectizer and RESTinio in action: a real-world example
arataga. SObjectizer and RESTinio in action: a real-world example
 
Date Processing Attracts Bugs or 77 Defects in Qt 6
Date Processing Attracts Bugs or 77 Defects in Qt 6Date Processing Attracts Bugs or 77 Defects in Qt 6
Date Processing Attracts Bugs or 77 Defects in Qt 6
 
Bot builder v4 HOL
Bot builder v4 HOLBot builder v4 HOL
Bot builder v4 HOL
 
PVS-Studio vs Chromium. 3-rd Check
PVS-Studio vs Chromium. 3-rd CheckPVS-Studio vs Chromium. 3-rd Check
PVS-Studio vs Chromium. 3-rd Check
 
Testing RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured frameworkTesting RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured framework
 
ajax_pdf
ajax_pdfajax_pdf
ajax_pdf
 
my accadanic project ppt
my accadanic project pptmy accadanic project ppt
my accadanic project ppt
 
Analysis of bugs in Orchard CMS
Analysis of bugs in Orchard CMSAnalysis of bugs in Orchard CMS
Analysis of bugs in Orchard CMS
 
Creating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationCreating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat Application
 
Android session-5-sajib
Android session-5-sajibAndroid session-5-sajib
Android session-5-sajib
 
MQTT and Java - Client and Broker Examples
MQTT and Java - Client and Broker ExamplesMQTT and Java - Client and Broker Examples
MQTT and Java - Client and Broker Examples
 
Dependency Injection for Android
Dependency Injection for AndroidDependency Injection for Android
Dependency Injection for Android
 
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desai
 
Parallel Programming With Dot Net
Parallel Programming With Dot NetParallel Programming With Dot Net
Parallel Programming With Dot Net
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
 
6.Spring DI_1
6.Spring DI_16.Spring DI_1
6.Spring DI_1
 
JS
JSJS
JS
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 

Viewers also liked

What’s new in SObjectizer 5.5.8
What’s new in SObjectizer 5.5.8What’s new in SObjectizer 5.5.8
What’s new in SObjectizer 5.5.8Yauheni Akhotnikau
 
Big data and Predictive Analytics By : Professor Lili Saghafi
Big data and Predictive Analytics By : Professor Lili SaghafiBig data and Predictive Analytics By : Professor Lili Saghafi
Big data and Predictive Analytics By : Professor Lili SaghafiProfessor Lili Saghafi
 
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itSergey Platonov
 
C++ Core Guidelines
C++ Core Guidelines C++ Core Guidelines
C++ Core Guidelines Sergey Zubkov
 
15years of Service with IBM MEA and 20 years with IBM in total
15years of Service with IBM MEA and 20 years with IBM in total15years of Service with IBM MEA and 20 years with IBM in total
15years of Service with IBM MEA and 20 years with IBM in totalMohamed El-Shanawany
 
Actor Model and C++: what, why and how?
Actor Model and C++: what, why and how?Actor Model and C++: what, why and how?
Actor Model and C++: what, why and how?Yauheni Akhotnikau
 
Five keys to successful cloud migration
Five keys to successful cloud migrationFive keys to successful cloud migration
Five keys to successful cloud migrationIBM
 
Design in Tech Report 2017
Design in Tech Report 2017Design in Tech Report 2017
Design in Tech Report 2017John Maeda
 

Viewers also liked (11)

What’s new in SObjectizer 5.5.8
What’s new in SObjectizer 5.5.8What’s new in SObjectizer 5.5.8
What’s new in SObjectizer 5.5.8
 
Big data and Predictive Analytics By : Professor Lili Saghafi
Big data and Predictive Analytics By : Professor Lili SaghafiBig data and Predictive Analytics By : Professor Lili Saghafi
Big data and Predictive Analytics By : Professor Lili Saghafi
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
 
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against itEvgeniy Muralev, Mark Vince, Working with the compiler, not against it
Evgeniy Muralev, Mark Vince, Working with the compiler, not against it
 
C++ Core Guidelines
C++ Core Guidelines C++ Core Guidelines
C++ Core Guidelines
 
15years of Service with IBM MEA and 20 years with IBM in total
15years of Service with IBM MEA and 20 years with IBM in total15years of Service with IBM MEA and 20 years with IBM in total
15years of Service with IBM MEA and 20 years with IBM in total
 
Google Cloud Platform
Google Cloud PlatformGoogle Cloud Platform
Google Cloud Platform
 
Actor Model and C++: what, why and how?
Actor Model and C++: what, why and how?Actor Model and C++: what, why and how?
Actor Model and C++: what, why and how?
 
Phygital
PhygitalPhygital
Phygital
 
Five keys to successful cloud migration
Five keys to successful cloud migrationFive keys to successful cloud migration
Five keys to successful cloud migration
 
Design in Tech Report 2017
Design in Tech Report 2017Design in Tech Report 2017
Design in Tech Report 2017
 

Similar to Dive into SObjectizer 5.5. Seventh part: Message Limits

What is SObjectizer 5.7 (at v.5.7.0)
What is SObjectizer 5.7 (at v.5.7.0)What is SObjectizer 5.7 (at v.5.7.0)
What is SObjectizer 5.7 (at v.5.7.0)Yauheni Akhotnikau
 
What's new in SObjectizer 5.5.9
What's new in SObjectizer 5.5.9What's new in SObjectizer 5.5.9
What's new in SObjectizer 5.5.9Yauheni Akhotnikau
 
What is SObjectizer 5.6 (at v.5.6.0)
What is SObjectizer 5.6 (at v.5.6.0)What is SObjectizer 5.6 (at v.5.6.0)
What is SObjectizer 5.6 (at v.5.6.0)Yauheni Akhotnikau
 
Combine Framework
Combine FrameworkCombine Framework
Combine FrameworkCleveroad
 
Manual testing interview questions
Manual testing interview questionsManual testing interview questions
Manual testing interview questionsBABAR MANZAR
 
Mdb dn 2016_07_elastic_search
Mdb dn 2016_07_elastic_searchMdb dn 2016_07_elastic_search
Mdb dn 2016_07_elastic_searchDaniel M. Farrell
 
Poject documentation deepak
Poject documentation deepakPoject documentation deepak
Poject documentation deepakchetankane
 
An Ideal Way to Integrate a Static Code Analyzer into a Project
An Ideal Way to Integrate a Static Code Analyzer into a ProjectAn Ideal Way to Integrate a Static Code Analyzer into a Project
An Ideal Way to Integrate a Static Code Analyzer into a ProjectPVS-Studio
 
Android 8 behavior changes
Android 8 behavior changesAndroid 8 behavior changes
Android 8 behavior changesInnovationM
 
Reactive Applications with Apache Pulsar and Spring Boot
Reactive Applications with Apache Pulsar and Spring BootReactive Applications with Apache Pulsar and Spring Boot
Reactive Applications with Apache Pulsar and Spring BootVMware Tanzu
 
Javascripts hidden treasures BY - https://geekyants.com/
Javascripts hidden treasures            BY  -  https://geekyants.com/Javascripts hidden treasures            BY  -  https://geekyants.com/
Javascripts hidden treasures BY - https://geekyants.com/Geekyants
 
Book management system
Book management systemBook management system
Book management systemSHARDA SHARAN
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx javaCongTrung Vnit
 

Similar to Dive into SObjectizer 5.5. Seventh part: Message Limits (20)

What is SObjectizer 5.7 (at v.5.7.0)
What is SObjectizer 5.7 (at v.5.7.0)What is SObjectizer 5.7 (at v.5.7.0)
What is SObjectizer 5.7 (at v.5.7.0)
 
What's new in SObjectizer 5.5.9
What's new in SObjectizer 5.5.9What's new in SObjectizer 5.5.9
What's new in SObjectizer 5.5.9
 
What is SObjectizer 5.6 (at v.5.6.0)
What is SObjectizer 5.6 (at v.5.6.0)What is SObjectizer 5.6 (at v.5.6.0)
What is SObjectizer 5.6 (at v.5.6.0)
 
Matopt
MatoptMatopt
Matopt
 
Combine Framework
Combine FrameworkCombine Framework
Combine Framework
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
 
Meteor
MeteorMeteor
Meteor
 
Manual testing interview questions
Manual testing interview questionsManual testing interview questions
Manual testing interview questions
 
Mdb dn 2016_07_elastic_search
Mdb dn 2016_07_elastic_searchMdb dn 2016_07_elastic_search
Mdb dn 2016_07_elastic_search
 
How to build typing indicator in a Chat app
How to build typing indicator in a Chat appHow to build typing indicator in a Chat app
How to build typing indicator in a Chat app
 
Poject documentation deepak
Poject documentation deepakPoject documentation deepak
Poject documentation deepak
 
An Ideal Way to Integrate a Static Code Analyzer into a Project
An Ideal Way to Integrate a Static Code Analyzer into a ProjectAn Ideal Way to Integrate a Static Code Analyzer into a Project
An Ideal Way to Integrate a Static Code Analyzer into a Project
 
Android 8 behavior changes
Android 8 behavior changesAndroid 8 behavior changes
Android 8 behavior changes
 
Reactive Applications with Apache Pulsar and Spring Boot
Reactive Applications with Apache Pulsar and Spring BootReactive Applications with Apache Pulsar and Spring Boot
Reactive Applications with Apache Pulsar and Spring Boot
 
Javascripts hidden treasures BY - https://geekyants.com/
Javascripts hidden treasures            BY  -  https://geekyants.com/Javascripts hidden treasures            BY  -  https://geekyants.com/
Javascripts hidden treasures BY - https://geekyants.com/
 
Book management system
Book management systemBook management system
Book management system
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx java
 
1844 1849
1844 18491844 1849
1844 1849
 
1844 1849
1844 18491844 1849
1844 1849
 
SDJ
SDJSDJ
SDJ
 

More from Yauheni Akhotnikau

Actor Model and C++: what, why and how? (March 2020 Edition)
Actor Model and C++: what, why and how? (March 2020 Edition)Actor Model and C++: what, why and how? (March 2020 Edition)
Actor Model and C++: what, why and how? (March 2020 Edition)Yauheni Akhotnikau
 
[C++ CoreHard Autumn 2018] Actors vs CSP vs Task...
[C++ CoreHard Autumn 2018] Actors vs CSP vs Task...[C++ CoreHard Autumn 2018] Actors vs CSP vs Task...
[C++ CoreHard Autumn 2018] Actors vs CSP vs Task...Yauheni Akhotnikau
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Yauheni Akhotnikau
 
Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...
Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...
Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...Yauheni Akhotnikau
 
Акторы на C++: стоило ли оно того?
Акторы на C++: стоило ли оно того?Акторы на C++: стоило ли оно того?
Акторы на C++: стоило ли оно того?Yauheni Akhotnikau
 
25 Years of C++ History Flashed in Front of My Eyes
25 Years of C++ History Flashed in Front of My Eyes25 Years of C++ History Flashed in Front of My Eyes
25 Years of C++ History Flashed in Front of My EyesYauheni Akhotnikau
 
GECon 2017: C++ - a Monster that no one likes but that will outlast them all
GECon 2017: C++ - a Monster that no one likes but that will outlast them allGECon 2017: C++ - a Monster that no one likes but that will outlast them all
GECon 2017: C++ - a Monster that no one likes but that will outlast them allYauheni Akhotnikau
 
Шишки, набитые за 15 лет использования акторов в C++
Шишки, набитые за 15 лет использования акторов в C++Шишки, набитые за 15 лет использования акторов в C++
Шишки, набитые за 15 лет использования акторов в C++Yauheni Akhotnikau
 
Для чего мы делали свой акторный фреймворк и что из этого вышло?
Для чего мы делали свой акторный фреймворк и что из этого вышло?Для чего мы делали свой акторный фреймворк и что из этого вышло?
Для чего мы делали свой акторный фреймворк и что из этого вышло?Yauheni Akhotnikau
 
Модель акторов и C++ что, зачем и как?
Модель акторов и C++ что, зачем и как?Модель акторов и C++ что, зачем и как?
Модель акторов и C++ что, зачем и как?Yauheni Akhotnikau
 
Погружение в SObjectizer 5.5. Вводная часть
Погружение в SObjectizer 5.5. Вводная частьПогружение в SObjectizer 5.5. Вводная часть
Погружение в SObjectizer 5.5. Вводная частьYauheni Akhotnikau
 

More from Yauheni Akhotnikau (12)

Actor Model and C++: what, why and how? (March 2020 Edition)
Actor Model and C++: what, why and how? (March 2020 Edition)Actor Model and C++: what, why and how? (March 2020 Edition)
Actor Model and C++: what, why and how? (March 2020 Edition)
 
[C++ CoreHard Autumn 2018] Actors vs CSP vs Task...
[C++ CoreHard Autumn 2018] Actors vs CSP vs Task...[C++ CoreHard Autumn 2018] Actors vs CSP vs Task...
[C++ CoreHard Autumn 2018] Actors vs CSP vs Task...
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
 
Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...
Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...
Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...
 
Акторы на C++: стоило ли оно того?
Акторы на C++: стоило ли оно того?Акторы на C++: стоило ли оно того?
Акторы на C++: стоило ли оно того?
 
25 Years of C++ History Flashed in Front of My Eyes
25 Years of C++ History Flashed in Front of My Eyes25 Years of C++ History Flashed in Front of My Eyes
25 Years of C++ History Flashed in Front of My Eyes
 
GECon 2017: C++ - a Monster that no one likes but that will outlast them all
GECon 2017: C++ - a Monster that no one likes but that will outlast them allGECon 2017: C++ - a Monster that no one likes but that will outlast them all
GECon 2017: C++ - a Monster that no one likes but that will outlast them all
 
Шишки, набитые за 15 лет использования акторов в C++
Шишки, набитые за 15 лет использования акторов в C++Шишки, набитые за 15 лет использования акторов в C++
Шишки, набитые за 15 лет использования акторов в C++
 
Для чего мы делали свой акторный фреймворк и что из этого вышло?
Для чего мы делали свой акторный фреймворк и что из этого вышло?Для чего мы делали свой акторный фреймворк и что из этого вышло?
Для чего мы делали свой акторный фреймворк и что из этого вышло?
 
Модель акторов и C++ что, зачем и как?
Модель акторов и C++ что, зачем и как?Модель акторов и C++ что, зачем и как?
Модель акторов и C++ что, зачем и как?
 
Погружение в SObjectizer 5.5. Вводная часть
Погружение в SObjectizer 5.5. Вводная частьПогружение в SObjectizer 5.5. Вводная часть
Погружение в SObjectizer 5.5. Вводная часть
 
Обзор SObjectizer 5.5
Обзор SObjectizer 5.5Обзор SObjectizer 5.5
Обзор SObjectizer 5.5
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Dive into SObjectizer 5.5. Seventh part: Message Limits

  • 1. Dive into SObjectizer-5.5 SObjectizer Team, Jan 2016 Seventh Part: Message Limits (at v.5.5.15)
  • 2. This is the next part of the series of presentations with deep introduction into features of SObjectizer-5.5. This part is dedicated to message limits feature. This feature is intended to use in protection of agents from overloading. SObjectizer Team, Jan 2016
  • 4. The main way of interaction between agents in SObjectizer is asynchronous messages. It makes very easy to use “fire-and-forget” scheme: ● an agent A finishes its own part of work, sends the result as a message to agent B and starts new processing; ● agent B receives a message, processes it and sends a new message to agent C; ● agent C receives a message, processes it and sends… This is very simple scheme but... SObjectizer Team, Jan 2016
  • 5. ...what if some agent in this chain processes messages much slower than the other agents which send new messages to it? This problem is known as overloading of agent. SObjectizer Team, Jan 2016
  • 6. Overloading leads to growth of event queues. Event queues eat more and more memory. Growing memory usage slows down the application. Lower speed leads to faster growth of event queues… As a result of overloading the application is degraded and should be killed in most cases. SObjectizer Team, Jan 2016
  • 7. There is no simple solution for overloading problem because a good overload control scheme for a particular application- specific agent will be very domain-specific and, probably, can’t be reused in another project. So, there is no ready-to-use just out-of-box tool or mechanism in SObjectizer which could be seen as ‘one size fits all’ solution for overloading problem. SObjectizer Team, Jan 2016
  • 8. But there is a mechanism which can protect agents from overloading in simple situations. This mechanism is known as message limits. SObjectizer Team, Jan 2016
  • 9. Message limits is an optional feature which can be turned on for individual agent. If message limits is turned on for an agent SObjectizer will count instances of messages in agent’s event queue. When number of messages of particular type exceeds limit for that type SObjectizer performs an overlimit reaction which is specified by user. SObjectizer Team, Jan 2016
  • 10. Types Of Overlimit Reactions SObjectizer Team, Jan 2016
  • 11. There are several overlimit reactions which can be performed by SObjectizer: ● dropping new messages; ● killing the whole application by std::abort(); ● redirecting new messages to another mbox; ● transforming new messages to messages of different types (with possibility to redirect them to different mboxes). SObjectizer Team, Jan 2016
  • 12. Message dropping is the simplest form of overlimit reactions. It means that a new message of type T which exceeds limit for messages of type T will be ignored and will not be pushed to event queue of the subscriber. This type of reaction can be useful if there is an intensive flow of messages and losing of several messages is not a problem. For example: ignored message will be repeated by sender after some timeout. SObjectizer Team, Jan 2016
  • 13. Another simple overlimit reaction is killing the whole application by std::abort(). This overlimit reaction can be used in scenarios where the application must guarantee some throughput but can’t do that. For example: an agent should process messages quite quickly. But there is a bug in the agent’s implementation and sometimes it fell into infinite loop. The only solution there is killing the app and restart it. SObjectizer Team, Jan 2016
  • 14. The next overlimit reaction is redirection of a new message to another mbox. This type of reaction could be used in different schemes: ● a very simple load balancing with agents A1, A2, ..., An. Agent A1 redirects messages to A2. A2 redirects to A3 and so on; ● different kind of processing by different subscribers. There could be agent N which does a normal processing. On overload it redirects messages to agent P which just sends back a reply “system is busy, try later”. SObjectizer Team, Jan 2016
  • 15. The last and most complex reaction is transformation with optional redirection. This type of reaction could be used in implementing complex domain-specific schemes of overload control. For example, an overloaded agent could transform new messages into signals about overloaded state and sends it to an overload controller. The controller can perform some actions like changing processing params, disconnecting some clients, switching off some logging and so on... SObjectizer Team, Jan 2016
  • 16. Maximum Overlimit Reaction Deep SObjectizer Team, Jan 2016
  • 17. There is a possibility of redirection loops for overlimit reactions of ‘redirect’ and ‘transform’ types. For example: agent A1 redirects message to A2, A2 redirects to A3, …, An redirects back to A1. Without a control of recursion of overlimit reactions infinite loops inside message delivery procedure could arise. SObjectizer Team, Jan 2016
  • 18. Because of that SObjectizer limits the number of overlimit reactions which are performed during the delivery of a message instance. This is called ‘overlimit_deep’ and the current maximum value of overlimit_deep is 16. This value is hardcoded in the current SObjectizer implementation and can’t be changed in run-time. SObjectizer Team, Jan 2016
  • 19. When maximum value of overlimit_deep is reached then a delivery of message is aborted by raising so_5::exception_t with the appropriate error code. Please note that if it is a delivery via multi-consumer mbox then some subscribers will not receive a message. Even if they do not use message limits at all. It is because the whole delivery procedure is canceled. SObjectizer Team, Jan 2016
  • 20. How To Specify Message Limits? SObjectizer Team, Jan 2016
  • 21. This part of presentation contains some examples of message limits definition. But before going deep into code samples some important rules first... SObjectizer Team, Jan 2016
  • 22. If an agent defines message limit for some message type T it must also define message limits for all other message types it processes. If an agent defines message limit for type T and tries to make a subscription for message of type M which hasn’t defined limit there will be an error. SObjectizer Team, Jan 2016
  • 23. Message limits are defined at the moment of agent’s construction and can’t be changed or removed later. Definition of message limits are passed to the constructor of so_5::agent_t or to coop_t::define_agent() method via so_5:: context_t object. SObjectizer Team, Jan 2016
  • 24. Definition of message limits with ‘drop message’ overlimit reaction could look like: // For ordinary agents: class request_processor : public so_5::agent_t { public : request_processor( context_t ctx ) : so_5::agent_t( ctx // No more than 20 messages with dropping of extra messages. + limit_then_drop< request >( 20 ) // No more than 1 message with dropping of extra messages. + limit_then_drop< get_status >( 1 ) ) ... }; // For ad-hoc agents: coop.define_agent( coop.make_agent_context() + so_5::agent_t::limit_then_drop< request >( 20 ) + so_5::agent_t::limit_then_drop< get_status >( 1 ) )... SObjectizer Team, Jan 2016
  • 25. Definition of message limits with ‘abort the app’ overlimit reaction could look like: // For ordinary agents: class hardware_interface : public so_5::agent_t { public : hardware_interface( context_t ctx ) : so_5::agent_t( ctx // Usually there must be no more than 10 waiting commands. // But if something goes wrong and hardware part doesn't respond // it is better to terminate the whole application. + limit_then_abort< outgoing_apdu_command >( 500 ) ) ... }; // For ad-hoc agents: coop.define_agent( coop.make_agent_context() + so_5::agent_t::limit_then_abort< outgoing_apdu_command >( 500 ) ); SObjectizer Team, Jan 2016
  • 26. Definition of message limits with ‘redirect’ overlimit reaction could look like: class normal_request_processor : public so_5::agent_t { public : normal_request_processor( context_t ctx, // Message box of agent for handling requests in overload mode. // In this mode requests are not processed but negative response with the appropriate // result code is sent back (and this fact is stored in the application log). so_5::mbox_t overload_mode_processor ) : so_5::agent_t( ctx // We can hold no more that 10 requests in queue. // All extra messages must be redirected to overload-mode processor // for generation of negative replies. + limit_then_redirect< request >( 10, [overload_mode_processor] { return overload_mode_processor; } ) ... }; SObjectizer Team, Jan 2016
  • 27. Definition of message limits with ‘transform’ overlimit reaction could look like (for the case of a message): class request_processor : public so_5::agent_t { public : normal_request_processor( context_t ctx ) : so_5::agent_t( ctx // We can hold no more that 10 requests in queue. // For all extra messages negative replies must be generated. + limit_then_transform( 10, [](const request & evt) { return make_transformed< negative_reply >( // Mbox for sending reply is got from original request. evt.reply_to(), // All other arguments are passed to negative_reply constructor. error_code::processor_is_busy ); } ) ) {} ... }; SObjectizer Team, Jan 2016
  • 28. Definition of message limits with ‘transform’ overlimit reaction could look like (for the case of a signal): class long_operation_performer : public so_5::agent_t { public : long_operation_performer( context_t ctx, so_5::mbox_t mbox_for_notifications ) : so_5::agent_t( ctx // If we cannot process previous get_status signal // then we are busy and can tell about this. + limit_then_transform< get_status >( 1, [this, mbox_for_notifications] { // The result of the transformation is another signal and because of that // there is only one argument for make_transform (the target mbox). return make_transformed< status_busy >( notification_mbox ); } ) ) {} ... }; SObjectizer Team, Jan 2016
  • 30. This presentation is just a short introduction in the topic of message limits. For more detailed information please see the corresponding section of Project’s Wiki. But it is necessary to remember that message limits is not a fullfledged solution for overload problem... SObjectizer Team, Jan 2016
  • 31. Message limits could be seen as a basic building blocks for more complex application- and domain-specific overload control schemes. Some examples of such schemes which are based on collector- performer agents pairs are represented in several examples in the SObjectizer’s distribution (they are also described in Project’s Wiki): ● work_generation; ● collector_performer_pair and collector_many_performers; ● simple_message_deadline; ● prio_work_stealing. SObjectizer Team, Jan 2016
  • 32. Additional Information: Project’s home: http://sourceforge.net/projects/sobjectizer Documentation: http://sourceforge.net/p/sobjectizer/wiki/ Forum: http://sourceforge.net/p/sobjectizer/discussion/ Google-group: https://groups.google.com/forum/#!forum/sobjectizer GitHub mirror: https://github.com/masterspline/SObjectizer