Server side timer?

79 views
Skip to first unread message

simo

unread,
Mar 23, 2013, 7:01:19 AM3/23/13
to haxe...@googlegroups.com
Hello,

I've created a js haxe project, but not to run at client side, I want to run it as an algorithm calculator at node js server.
The problem is I need to use a timer, the timer function at haxe will be compiled to use window.setInterval, which of course will not work at server side.

Is there an alternative to haxe timer in my case?

Thanks

Juraj Kirchheim

unread,
Mar 23, 2013, 7:17:21 AM3/23/13
to haxe...@googlegroups.com
Are you using blackdog's externals?

https://github.com/cloudshift/hx-node/blob/master/js/Node.hx

Therein you have Node.setInterval.

A hacky alternative is to inject some raw javascript that redeclares
window: `var window = global`

Regards,
Juraj

simo

unread,
Mar 23, 2013, 7:56:59 AM3/23/13
to haxe...@googlegroups.com
Yes, I am using nodejs externs, Node.setInterval solved the problem, thanks!
Reply all
Reply to author
Forward
0 new messages