Comments (4)
Comment author: Clément Delgrange <[email protected]>
Overview:
The JavaDoc of the PushbackPolicyOption.getPolicy method indicates that the time unit is nanoseconds, however, in the reference implementation org.osgi:org.osgi.util.pushstream:1.0.0, when a tasks is scheduled (eg; BufferedPushStreamImpl.startWorker), the time unit used is miliseconds.
The time unit of the time parameter is also missing in the JavaDoc of BufferBuilder.withPushbackPolicy(PushbackPolicyOption pushbackPolicyOption, long time)
Actual Results:
The user cannot decide which of the specification or the implementation is right. This may lead to bugs in the client code.
Expected Results:
Consistence between JavaDoc and implementation.
from design.
Comment author: Clément Delgrange <[email protected]>
Not sure if it is when a task is scheduled, but when a default PushBackPolicy is set in PushStreamProvider.createStream:
if (pushbackPolicy == null) {
pushbackPolicy = LINEAR.getPolicy(1000);
}
The provided time does not seem to be nanosecondes.
from design.
Comment author: Castro B <[email protected]>
(In reply to Clément Delgrange from comment BZ#1)
The provided time does not seem to be nanosecondes.
Hi Clement i really didn't get what you mean,
Castro B,
https://sparpedia.no
from design.
Comment author: Clément Delgrange <[email protected]>
Hi,
Sorry, I will try to be more explicit.
First, the abstract method PushbackPolicyOption.getPolicy(long value) indicates in its JavaDoc that this method create an instance configured with a base back pressure time in nanoseconds. So, I have assumed that the value
parameter must be a time in nanoseconds. As well as for each implementation LINEAR
, ON_FULL_EXPONENTIAL
, FIXED
, ...
Then, from a Tim Ward's answer on stackoverflow (https://stackoverflow.com/questions/53692861/osgi-pushstream-is-slow), he said:
When you create a stream using psp.createStream(source) it is set up with a buffer of 32 elements and a linear back pressure policy based on the size of the buffer, returning one second when full...
Now, when you look at the implementation of PushStreamProvider.createStream:
return createStream(eventSource, 1, null, null,
new ArrayBlockingQueue<>(32),
FAIL.getPolicy(), LINEAR.getPolicy(1000));
if the value provided to LINEAR.getPolicy is a time in milliseconds, when the buffer is full we will get a back pressure of 1 second ( 1000*32/(32+0)=1000ms=1s ) as Tim Ward said but not if it is nanoseconds.
Am I right, or I miss something?
from design.
Related Issues (20)
- Ordering issue with RFC-217 "osgi.jaxrs.filter.base" filters HOT 2
- rfc-217 should clarify how ApplicationPath annotation can affect the base path HOT 1
- RFC-217 support for Feature, DynamicFeature, ContextResolver and other providers HOT 3
- RFC-221 Transaction control: Release resources managed by JDBCConnectionProvider HOT 4
- Typos in RFC 221 Transaction Control - Drafs HOT 1
- RFC-229 MQTT Wildcard topics HOT 2
- [Converter] Conversion of Collections HOT 2
- R7 Core draft 2017-3, 10.8.4.3 (Capability and Requirement version params) HOT 2
- Configurer specification - partial configurations and merging (R8+) HOT 2
- Feature: support Optional<T> for DS service reference type HOT 3
- [RFC 216/ PushStream] Inconsistency between JavaDoc/Spec Section 706.7.14.6 and the reference implementation HOT 1
- Component "outjection" for declarative services. HOT 1
- rfc-241 (Feature) - json structure and comment HOT 4
- Offer BundleContext#registerService without HashTable HOT 4
- [JPA Service] allow a JPA Service to use the (non-)jta-data-source attribute instead of the javax.persistence.jdbc.driver property HOT 1
- DS 1.4 Component Property Types: Allow meta annotations or static fields for generating constant component properties HOT 3
- DS 1.4 Component Property Type Annotations: Allow elements which only optionally create component properties HOT 1
- DS: Allow a condition towards a framework property HOT 3
- DS: Allow conditions for a class being available to the classloader HOT 1
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 design.