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
package; | |
import sys.io.File; | |
/** | |
* Appveyor munit helper | |
* @author AxGord | |
*/ | |
class Main { | |
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
package; | |
import haxe.Timer; | |
import js.Node; | |
/** | |
* SlowServer | |
* @author AxGord | |
*/ | |
class SlowServer { |
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
package; | |
import pony.net.SocketClient; | |
import pony.net.SocketServer; | |
class StringSocketExample | |
{ | |
static function main() | |
{ |
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
import pony.net.http.HttpServer; | |
import pony.net.http.IHttpConnection; | |
class HttpServerExample { | |
static function main() { | |
new HttpServer().request = function(connection:IHttpConnection) { | |
connection.sendText('Hello world'); | |
}; | |
} | |
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
Neko | |
Main.hx:27: 224.676000595093 | |
Main.hx:40: 356.434999465942 | |
Cpp (32bit) | |
Main.hx:27: 20.1340007781982 | |
Main.hx:40: 106.84700012207 | |
C# (64bit) | |
Main.hx:27: 15.3541984558105 | |
Main.hx:40: 234.727904319763 | |
Java |
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
package; | |
import pony.Priority; | |
import haxe.Constraints.Function; | |
#if (cs||java) | |
typedef Listener1<T1> = {args:Int, f:T1->Void}; | |
#else | |
typedef Listener1<T1> = T1->Void; | |
#end |
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
package; | |
import pony.events.Signal; | |
/** | |
* ... | |
* @author AxGord <axgord@gmail.com> | |
*/ | |
class SignalTest { | |
static function main() { |
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
macro public function add(th:Expr, f:Expr, ?priority:ExprOf<Int>):Expr { | |
if (priority == null) priority = macro 0; | |
return switch Context.typeExpr(f).t { | |
case TFun(args, ret): | |
switch ret { | |
case TAbstract(t, p): | |
var n = t.get().name; | |
if (n != 'Bool' && n != 'Void') | |
Context.fatalError('Wrong return type', Context.currentPos()); |
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
static function streamToString() { | |
var streamInput = new Event1<Int>(); | |
var streamOutput:Signal1<Int> = streamInput; | |
var subStream = streamOutput.convert1( | |
function(e:Event1<String>, v:Int) e.dispatch(v == 2 ? 'two' : Std.string(v)) | |
); | |
subStream.add(function(s:String) trace(s)); | |
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
package ; | |
import flash.display.StageAlign; | |
import flash.display.StageScaleMode; | |
import flash.Lib; | |
import flash.text.TextField; | |
import flash.text.TextFieldType; | |
import flash.events.Event; | |
/** |