Skip to content

benmerckx/asys

Repository files navigation

asys

Build Status Gitter

Asynchronous sys module for all sys targets and node.js. The structure mimics the haxe std sys classes. Each method has an asynchronous counterpart in asys. Asynchronous methods return a Future<Data> or a Promise<Data>.

For example where you would previously write

trace(FileSystem.exists(path));

That would become

FileSystem.exists(path).handle(function(exists)
	trace(exists)
);

Using tink_await this can be written as:

trace(@await FileSystem.exists(path));

There other shortcuts for working with futures and promises which you can find in the tink_core documentation.

Currently implemented

All methods are handled asynchronously on node.js.
On other targets all methods are implemented using Future.sync. If used in combination with tink_runloop, file io will be done asynchronously.

asys
	io
		File
		FileInput
		FileOutput
		FileSeek
		Process
	net
		Host
		Socket
	ssl
		Socket
	FileStat
	FileSystem

License: MIT