Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ikorennoy/jasyncfio
Java asynchronous file I/O based on io_uring Linux interface
https://github.com/ikorennoy/jasyncfio
asyncronous file-io file-io-in-java io-uring java non-blocking-io
Last synced: about 1 month ago
JSON representation
Java asynchronous file I/O based on io_uring Linux interface
- Host: GitHub
- URL: https://github.com/ikorennoy/jasyncfio
- Owner: ikorennoy
- License: apache-2.0
- Created: 2021-10-15T18:54:18.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-11T18:15:22.000Z (over 1 year ago)
- Last Synced: 2024-05-22T15:30:57.643Z (7 months ago)
- Topics: asyncronous, file-io, file-io-in-java, io-uring, java, non-blocking-io
- Language: Java
- Homepage:
- Size: 497 KB
- Stars: 69
- Watchers: 6
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-iouring - Jasyncfio
README
# Jasyncfio
[![Build](https://github.com/ikorennoy/jasyncfio/actions/workflows/build.yml/badge.svg)](https://github.com/ikorennoy/jasyncfio/actions/workflows/build.yml)
Jasyncfio provides an asynchronous file I/O API based on the Linux io_uring interface.
## Jasyncfio Features
* Fully asynchronous io_uring based file I/O API
* API comes in two kinds: Buffered and Direct I/O
* API for linear access to file (depends on your file system)
* Using a wide range of io_uring features such as polling, registered buffers/files## Examples
```java
EventExecutor eventExecutor = EventExecutor.initDefault();CompletableFuture asyncFileCompletableFuture = AsyncFile.open(Paths.get("path/to/file"), eventExecutor);
AsyncFile file = asyncFileCompletableFuture.get();ByteBuffer byteBuffer = ByteBuffer.allocateDirect(1024);
CompletableFuture readCompletableFuture = file.read(byteBuffer);Integer readBytes = readCompletableFuture.get();
```If you want to dive deeper, there are more examples with explanations on the [wiki](https://github.com/ikorennoy/jasyncfio/wiki).
## Download
Releases are available at [Maven Central](https://search.maven.org/artifact/one.jasyncfio/jasyncfio).
Since the library uses native code, it is necessary to specify the classifier. At the moment there are releases only for linux-amd64, there are plans to support linux-arm64.
### Requirements
* Linux Kernel >= 5.11
* Java >= 8### Maven
```xml
one.jasyncfio
jasyncfio
0.0.8
linux-amd64```
### Gradle Groovy DSL
```groovy
implementation 'one.jasyncfio:jasyncfio:0.0.8:linux-amd64'
```### Gradle Kotlin DSL
```kotlin
implementation("one.jasyncfio:jasyncfio:0.0.8:linux-amd64")
```