https://github.com/streamich/libaio
asynchronous system call wrapper
https://github.com/streamich/libaio
Last synced: 9 months ago
JSON representation
asynchronous system call wrapper
- Host: GitHub
- URL: https://github.com/streamich/libaio
- Owner: streamich
- Created: 2016-07-23T20:23:12.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-05T09:31:49.000Z (over 8 years ago)
- Last Synced: 2025-08-09T09:52:07.670Z (11 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `libaio`
Asynchronous operations implemented using [`libjs`](http://www.npmjs.com/package/libjs).
This package is in a prototype stage as a proof of concept, it implements
a basic asynchronous `SocketTcp` class using `epoll` and `fcntl` system
calls from `libjs`. See below and async `GET` request example:
```js
import * as socket from 'libaio';
var sock = new libaio.SocketTcp();
sock.onconnect = () => {
console.log('Connected');
sock.write('GET /\n\n');
};
sock.ondata = (data) => {
console.log('Received:');
console.log(data);
};
sock.connect({host: '192.168.1.150', port: 80});
```