-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asys #8817
Closed
Closed
asys #8817
Changes from 4 commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
bec9818
libuv stubs, most fs functions
Aurel300 d68cb64
stat
Aurel300 b5ab085
fix linking
Aurel300 7929a23
initial eval code (FileSystem.exists)
Aurel300 0d81028
first async function, callbacks into Haxe
Aurel300 05aae0e
improve error handling, more fs work
Aurel300 eb2d506
report positions in errors
Aurel300 9af1f9e
less segfaulting, fs watchers, some cleanup and docs
Aurel300 b4d94d5
more cleanup and docs
Aurel300 61741df
move uv constants out, simplify stat
Aurel300 03018ce
close handles properly
Aurel300 f779f6f
tcp work
Aurel300 c0f2eb2
TCP, DNS, timers
Aurel300 3786432
socket options, fix connect
Aurel300 8ab1bc8
return DNS and scandir results in correct order
Aurel300 141c67f
unref timers
Aurel300 cb66ce2
async file operations
Aurel300 d1f08dc
TCP get(sock|peer)name
Aurel300 150d11c
read/write -> readBuffer/writeBuffer
Aurel300 7b379ec
udp stubs
Aurel300 b211f6b
UDP
Aurel300 3fded3b
allow run with any mode
Aurel300 3a0bbea
process stubs
Aurel300 4e1d1fd
process stdlib
Aurel300 ede92a0
ref, unref, less code that just casts handles
Aurel300 4dc047c
pipes
Aurel300 b7591e7
process close
Aurel300 2c26275
better pipes and streams
Aurel300 25e842b
get IPC name
Aurel300 66beabc
ref/unref UDP sockets
Aurel300 211e6ee
pass handles via pipes
Aurel300 4782ace
move to asys package
Aurel300 0d8bf4a
minor fixes
Aurel300 6a24d1b
fix dune
Aurel300 16306c1
macros for allocating/freeing requests
Aurel300 4da20b8
Merge branch 'development' into feature/eval-libuv
Simn 842dc16
[ci] setup Windows
Simn 61b33de
Merge branch 'development' into feature/eval-libuv
Simn 9f9e810
bring back Sys inclusion hack
Simn db0d9a0
womp womp
Simn 831123c
fix Std.hx
Simn 6678277
[ci] setup Linux and OS X
Simn 6809c38
[std] add missing get_message
Simn de2b204
add asys Haxe APIs, asys test suite
Aurel300 0051e49
minor stubs changes
Aurel300 6b8a04a
Merge branch 'feature/eval-libuv' of github.com:Aurel300/haxe into fe…
Aurel300 d33b27c
some test setup fixes
Aurel300 a229959
fix xmldoc
Aurel300 a392e9e
skip some tests on Windows
Aurel300 c4ee323
(revert later) skip docgen
Aurel300 df401d8
[ci] enable win32 macro tests again
Simn ef3cdc7
(revert later) ughh
Aurel300 51b5ecf
don't leave access.txt in read-only so we can clean up
Simn 94755ee
Merge branch 'development' into feature/eval-libuv
Simn c1e5290
start on dealing with flag values
Simn 3cdbcdf
disable test that's probably invalid on Windows
Simn ba637ea
adjust tests to windows limitations
Simn 7408547
[ci] install libuv manually on Linux
Aurel300 d065543
maybe fix Linux ci
Aurel300 bd97e56
sudo make ci work
Aurel300 27db9e6
disable watcher test on Linux
Aurel300 2d54ddc
error code docstrings
Aurel300 7a8ab7d
(eval) add lchown and copyfile
Aurel300 4d0270f
no callback on process_kill
Aurel300 3e5919d
use 32-bit ints for IPv4
Aurel300 5dbfef6
[libuv] prepare libuv integration
Simn 56ad076
[ci] bring back docgen
Simn c047d43
...
Simn 4f6d9a5
avoid dll problem
Simn d3ede31
no target is asys yet
Simn 7b39cf4
cleanup
Simn 3a3ce68
fix pointer warnings
Simn 18f98b5
check for libuv >= 1.31
Simn 1a17c34
close file in FileSystem.writeFile
Simn 1dfb708
add asys define, forbid asys package on all targets for now
Aurel300 5b1acbc
eval is asys here
Simn 3fa47f5
merge asys.Timer into haxe.Timer
Simn ba4aae7
run Uv.init/close just once in the asys tests
Simn 0fdd3e8
hijack haxe.EntryPoint to deal with UV initialization
Simn f03ff69
fix FileWatcherEvent and adjust test
Simn 7cfbb83
use distinct directory per-test
Simn c67ed00
fix tests
Simn 552e238
don't unlink
Simn 896eba7
remove more random cleanup code
Simn bd0c345
simplify alloc_data
Aurel300 2e2f16c
Merge branch 'development' into feature/libuv-prepare
Simn 1a10736
Merge branch 'feature/libuv-prepare' into feature/eval-libuv
Simn 9e53d3c
port server tests to asys
Simn e8989ae
disable wonky watcher test for now
Simn f52b2d7
fix haxeserver branch
Simn 5ea451c
check something
Simn 715f8ef
disable unused include
Simn 99a6663
move UV.init to asys.uv.Uv.__init__
Simn 49a40f0
remove imports
Simn fa74d66
add mutex and TLS externs
Simn 7cd7425
don't allocate so much
Simn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,15 @@ | |
|
||
package haxe; | ||
|
||
#if (target.asys) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's no longer necessary to put dot-defines in parens? |
||
private typedef Native = | ||
#if eval | ||
eval.uv.Timer; | ||
#else | ||
#error "Missing asys implementation" | ||
#end | ||
#end | ||
|
||
/** | ||
The `Timer` class allows you to create asynchronous timers on platforms that | ||
support events. | ||
|
@@ -42,6 +51,8 @@ class Timer { | |
#elseif java | ||
private var timer:java.util.Timer; | ||
private var task:java.util.TimerTask; | ||
#elseif (target.asys) | ||
private var native:Native; | ||
#else | ||
private var event:MainLoop.MainEvent; | ||
#end | ||
|
@@ -69,6 +80,8 @@ class Timer { | |
#elseif java | ||
timer = new java.util.Timer(); | ||
timer.scheduleAtFixedRate(task = new TimerTask(this), haxe.Int64.ofInt(time_ms), haxe.Int64.ofInt(time_ms)); | ||
#elseif (target.asys) | ||
native = new Native(time_ms, () -> run()); | ||
#else | ||
var dt = time_ms / 1000; | ||
event = MainLoop.add(function() { | ||
|
@@ -103,6 +116,8 @@ class Timer { | |
timer = null; | ||
} | ||
task = null; | ||
#elseif (target.asys) | ||
native.close((err) -> {}); | ||
#else | ||
if (event != null) { | ||
event.stop(); | ||
|
@@ -121,12 +136,24 @@ class Timer { | |
var timer = new haxe.Timer(1000); // 1000ms delay | ||
timer.run = function() { ... } | ||
``` | ||
|
||
Once bound, it can still be rebound to different functions until `this` | ||
Timer is stopped through a call to `this.stop`. | ||
**/ | ||
public dynamic function run() {} | ||
|
||
public function ref() { | ||
#if (target.asys) | ||
native.ref(); | ||
#end | ||
} | ||
|
||
public function unref() { | ||
#if (target.asys) | ||
native.unref(); | ||
#end | ||
} | ||
|
||
/** | ||
Invokes `f` after `time_ms` milliseconds. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have both
target.asys
andasys
? I thought the defines not prefixed bytarget.
are just for backwards compatibility.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have
sys
we should also haveasys
, otherwise this is just one giant trap.