Replies: 3 comments 6 replies
-
The way workers work is to essentially set up a secondary (albeit slimmed down) runtime in a separate thread, and it initialises the 'player' object using a SWF file format.. so, at some point, there needs to be the 'dark magic' for this. But potentially we could provide this natively i.e. provide a new AS3 method to create a Worker from a Class and then we'd craft the rest of the SWF format around this.. although this would imply that the given Class has no dependencies on anything else? Are you thinking of this for fairly simple bits of async functionality that can be wholly encapsulated into a single Class? There's a danger that you could pass in a class that has dependencies on other (non-builtin) classes and then the worker would just fail to run.. thanks |
Beta Was this translation helpful? Give feedback.
-
Hi guys, We happen to have a class "WorkerManager" in the package "com.myflashlabs.utils.worker" that we invoke like this to create a new thread:
it's a class that we inherited when we had an all-in subscription to MyFlashLabs ANEs. I don't know if these classes were part of the subscription, but I see "The MIT License (MIT)" in the header comments of all these classes. Also in the comments I read that these classes are based on the work of: |
Beta Was this translation helpful? Give feedback.
-
The AS3 runtime is designed for a single thread, making the implementation of workers extremely costly, unlike any other language. Of course, other programming paradigms have started to embrace coroutines... |
Beta Was this translation helpful? Give feedback.
-
Currently, this requires third party libraries that pretty much involve some Low Level Dark Magic with a library called AS3SWF, but it'd be nicer to just be able to make a new worker from a class directly.
is there any chance AIR could have this natively?
Beta Was this translation helpful? Give feedback.
All reactions