Comments (3)
You are right one Result, we have one ReentrantReadWriteLock _lock
for all the application threads. But locks take place only during reading and writing (it is not exactly the same locks in reading as writing) not during the global processing.
from rulebook.
In com.deliveredtechnologies.rulebook.spring.RuleBean
you have @Scope("prototype")
Scope prototype means that every time you ask spring (getBean or dependency injection) for an instance it will create a new instance and give a reference to that.
If you check at com.deliveredtechnologies.rulebook.model.runner.AbstractRuleBookRunner
there is a call to Object ruleInstance = getRuleInstance(rule);
inside run
function.
For each rule object it will create a new instance.
In com.deliveredtechnologies.rulebook.Result
class you have a Map and a lock in order to deal with asynchronous problem:
private Map<Long, T> _valueMap = new HashMap<>();
private final ReentrantReadWriteLock _lock = new ReentrantReadWriteLock();
If you have one run per request, on each request you will have a different bean/object for each @RuleBean
or @Rule
POJOs.
You don't have to define Session scoped.
from rulebook.
AbstractRuleBookRunner
I see the single result that keeps results per thread. Does it mean that we have single lock in result for all the application threads? Is it really optimized for all threads to wait when a single request finishes its work?
from rulebook.
Related Issues (20)
- Why withDefaultResult is mandatory? HOT 4
- How can i write dynamic rules to execute rather than writing in java program .like rules defined in JSON or Yaml? HOT 4
- Add the Supplier function to avoid the passage by reference for the default result HOT 2
- Should I fork? HOT 2
- using codegen to improving performance of rule execution HOT 1
- Rule name is dropping when build Rule withFactType. HOT 1
- How to write Unit Tests for a RuleBean? HOT 1
- Switch CI to GitHub Actions HOT 2
- Deprecated classes/methods and non-compiling examples in README.md HOT 1
- Auditor not set on rules when RuleBookBuilder.create(Class) is used HOT 2
- Futures/CompletionStage/Async HOT 2
- Fact checking before evaluating rules HOT 2
- Rulebook in Spring Boot - stop execution
- Project status HOT 2
- Lambdas stack error
- RuleBuilder doesn't create a Rule with action type RuleChainActionType.ERROR_ON_FAILURE HOT 2
- RuleBookRunner4PojoClasses does not run rules according to the order property
- Would need an update on how frequently this project is developed and actively supported HOT 1
- Looking for Updates on Rule Book Project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rulebook.