asgeirn / circular-buffer Goto Github PK
View Code? Open in Web Editor NEWA Lock Free Concurrent Circular Buffer
License: MIT License
A Lock Free Concurrent Circular Buffer
License: MIT License
Given:
<dependency>
<groupId>no.twingine</groupId>
<artifactId>circular-buffer</artifactId>
<version>1.4</version>
</dependency>
When: mvn install
Then:
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/no/twingine/circular-buffer/1.4/circular-buffer-1.4.pom
[WARNING] The POM for no.twingine:circular-buffer:jar:1.4 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/no/twingine/circular-buffer/1.4/circular-buffer-1.4.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.265 s
[INFO] Finished at: 2023-12-01T05:17:15Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project xxx: Could not resolve dependencies for xxx:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: no.twingi
ne:circular-buffer:jar:1.4 (absent): Could not find artifact no.twingine:circular-buffer:jar:1.4 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
Root cause is that there is no published version on maven central. That implies that I need to build it locally else publish it locally. Folks are unlikely to do that.
Publishing to maven is a little bit of a pain but not a ton. The important part is that you add a LICENSE.txt and that you use an maven group name that doesn't look like you are cybersquatting. There is some gpg key signing and sonatype release mavn plug-in setup
. The first time you try to promote to live a human checks what you do. They were nice and told me to add a license and change my maven group name. After their manual checks for the first promotion after that it is automated when you sign and push a release to sonatype.
You should add a license file to this repo regardless as not having one means that people cannot use it who write software for clients who are aware of the legal risks of using software that has no defined opensource license.
Have a need to examine the contents of the circular buffer and build a list based on insert order.
Initially read your blog and the following snippet is based on your initial revision there.
public List<T> getAllOrdered() {
List<T> list = new Vector<T>(size);
for (int i = index.get() + 1; i < size; i++) {
if(buffer.get(i) != null)
list.add(buffer.get(i));
}
for (int i = 0; i < index.get() + 1; i++)
list.add(buffer.get(i));
return list;
}
The code might not be thread safe in that the buffer might get updated while I am building the list. Hoping I can download the code from github and use as a library with the above method included.
Regards
Suneet
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.