Comments (52)
I also having this issue though many other 'not-found' compiler issue when tried to use EasyWorker API (API/src/main/flex) through FB Source Path parameter. Is this only workable with Apache Flex 4.13 (not 4.12.1 even)?
Also, it would be great if you supply the .swc in Git only - we're having trouble to access sharebeast.com in India (not sure why though).
Again, thanks! for such a lovely API!
from easyworker.
It works only with the SDK 4.13+, you can install it via the official Apache Flex Installer selecting the nightly builds option, the reason is that I modified fdb.jar and created a DebuggableWorker class in this version of the SDK to make IDEs such as IntelliJ and FDT be able to debug Worker (As soon as they will adjust their IDEs a little bit though).
I'm sorry if you can't easily download the libs from India but I won't provide the swc thru github, instead, as soon as the SDK 4.13 will be officially out, I will mavenize it and mavenize as well this lib to make the swc available from everywhere.
In between, if you want to try it, I can share it elsewhere, just tell me what is the best for you.
Thanks for your feedback.
from easyworker.
I made customer compile with ThreadRunner extending from Sprite.
The other difficulty I found is when I try to use a custom complex VO class, the API told me that a lot of classes are missing like ArrayCollection, ListCollectionView and CursorBookmark.
Is there any better way to share properties under the same application domain without using extraDependencies ?
from easyworker.
To have them reflected and thus, included in the in-memory Worker, you need either, to declare them using extraDependencies or make your variables and methods public/protected in the your Runnable and in every custom dependencies it uses.
Thanks for trying 👍
from easyworker.
Can I attach a sample project I am using to explain the problem I have ?
Meanwhile there is no Flex 4.13 nightly after installing Flex Installer 3.1.0. Can you check it please ?
from easyworker.
Can I attach a sample project I am using to explain the problem I have ?
Yes
Meanwhile there is no Flex 4.13 nightly after installing Flex Installer 3.1.0. Can you check it please ?
Yes, there is but you need to right click on the first main screen and select this option.
from easyworker.
I am back with my account I should use :)
You will find the test project here : https://github.com/riadvice/easyWorker-ActiveAIRCord
It is using ActiveAIRCord, an Adobe AIR Active Record implementation working yet with some complex features and unit tested : https://github.com/riadvice/ActiveAIRCord
Just change the extending class for "GetEmployeesWorker" and it should work fine for you for Flex 4.13.0
I was not able to to install Flex 4.13.0, I got an error when installing playerglobals.
Waiting for your reply, I really hope we can make it work better together.
from easyworker.
It is very late already here, will test it tomorrow night though !
from easyworker.
I plugged it to the SDK 4.13, re-wrote a bit of stuffs and the Thread is running, only got some problem with the reflection, will give a deeper look on how to fix that when I'll get a chance and come back to you.
from easyworker.
Good news I will be happy to get your feedback. Meanwhile is it possible to work with databases inside a thread ? Did you get an error saying that the action should be ran inside the application sandbox ?
from easyworker.
Meanwhile is it possible to work with databases inside a thread ?
I'm sure it is possible to work with databases inside a thread because I'm adapating DownloadFileWorker to make it work using Thread and it uses SQLite.
What I'm not sure is if ActiveAIRCord will work with as we need to share the sub-classes of the Model (which are augmented via staticInitializer() at runtime) either via IThread.start() or CrossDispatcher.dispatchResult() or setSharedProperty (which use a SHARED ByteArray)
I'll tell you what I found as soon as I will have worked on it again, probably this week end.
Did you get an error saying that the action should be ran inside the application sandbox ?
No, use the giveAppPrivileges in the Thread constructor:
giveAppPrivileges (default = false) — indicates whether the worker should be given application sandbox privileges in AIR. This parameter is ignored in Flash Player
from easyworker.
I've spent a bit of time tonight too and the Employee runtime static method is called and bring back the expected result, the only problem I've got as I suspected before is that because every element of its prototype is added at runtime, it doesn't pass the AMF serialization/de-serialization that occurs between threads, if you find a way to make the lib not complaining during this phase, maybe using IExternalizable, I won't have this message [1] during the AMF process, the other way would be to bring back an Array of POJO as result.
Thought ?
[trace] got an Error in Run()Error #2105: The Proxy class does not implement nextNameIndex. It must be overridden by a s
ubclass. Error: Error #2105: The Proxy class does not implement nextNameIndex. It must be overridden by a subclass.
[trace] at Error$/throwError()
[trace] at flash.utils::Proxy/http://www.adobe.com/2006/actionscript/flash/proxy::nextNameIndex()
[trace] at flash.system::MessageChannel/send()
from easyworker.
The implementation of ActiveAIRCord library is incomplete and a lot of things to to be reviewed in team. Will the problem be solved if I implement nextNameIndex, nextName and nextValue to Model class ?
Can you remember me please what is the interface IExternalInterface ?
Will returning an Array of POJO or setting itemClass for the SQLStatement fix the problem ?
from easyworker.
I think the first thing is indeed to implement those Proxy methods, then, to make Model based classes pass the AMF process, implement IExternalizable interface see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/IExternalizable.html
Doing so, FP won't try to fill stupidly every properties it will meet.
And optionally, as it is always good to to have a toString method, you could implement a toValue method which return the content of the found elements such as a Pojo / Array of Pojo, depending of the content.
What do you think ?
from easyworker.
Hi Frédéric,
I understand your concern to not to share the SWC from GIT at this moment. Can you please share it at http://zippyshare.com for the moment (?)
Thanks, looking forward!
Regards,
Santanu
from easyworker.
@santanu4ver Will upload a new version probably this week a long with a new demo and will share this version on the share you indicated.
from easyworker.
@LionArt Just had a look at Model and how the find works, maybe implementing the missing Proxy methods would be enough, no needs to implement IExternalizable AFAICU at the moment
from easyworker.
Thanks Frédéric, looking forward to the new updates.
from easyworker.
Hi Frédéric,
I have added a quick implementation to missing flash_proxy methods. If you can give it try now. I have pushed the commit to my repository.
from easyworker.
I can't now, maybe tonight or this week end.
Did you updated https://github.com/riadvice/ActiveAIRCord accordingly ?
Did you check that each Model property can be read/write ? (necessary for AMF or use IExternalizable to do so)
from easyworker.
Yes all updates are pushed in into https://github.com/riadvice/ActiveAIRCord.
I just added the missing flash_proxy methods only. Implementing IExternalizable would be good fun. I will try to do it this week-end whenever I find some time.
from easyworker.
@LionArt Good news, it works !! see riadvice/easyWorker-ActiveAIRCord#1
I didn't use the AIRCord lib you pushed but recompiled from the sources with the IExternalizable implementation
from easyworker.
@santanu4ver In between you can get the Flex/AIR one here https://github.com/doublefx/easyWorker-ActiveAIRCord/tree/c98f0abb15a91134d99a8358f9604b82741b2b58/libs
from easyworker.
@LionArt Btw, you can try the last Apache Flex Installer RC https://dist.apache.org/repos/dist/dev/flex/installer/3.1/rc8/ to get the nightly SDK 4.13
from easyworker.
Thank you very much for updates on ActiveAIRCord. I am trying your update on ActiveAIRCord and Apache Flex Installer RC 8 now. Meanwhile how did you find ActiveAIRCord ? It is an incomplete port of php active-record and I improve it whenever I find time or when I work on commercial projects that needs some sqlite databases.
from easyworker.
That's a nice work indeed, good to know that exists, will integrate it in some future projects when I get a chance.
from easyworker.
Welcome onboard then, I have added you to ActiveAIRCord contributors under https://github.com/riadvice/easyWorker-ActiveAIRCord/
I am happy to welcome such talented developer. Feel free to improve its API and unit tests, the original project is here http://www.phpactiverecord.org/
from easyworker.
It looks like I'm taking more job :-)
Thanks.
from easyworker.
Let's say you are special guest from a person who already contributed to Flex SDK :). We share the same bread. I will confirm you that we can close this issue tomorrow when I put all my tests on the "real" project I am working on.
from easyworker.
After building my "real" project using easyWorker source code I got two errors :
- Thread class should no more be final, I guess you have not committed it yet.
- I get "1137: Incorrect number of arguments. Expected no more than 0." when I
thread = new DatabaseThread(DatabaseManagerWorker, "getChaptersWorker", DBConf.getEnryptionKey(true), models);
DatabaseThread is the equivalent of AIRCordThread and DatabaseManagerWorker is the equivalent of GetEmployeesWorker.
any idea how to resolve it ?
from easyworker.
I guess I uploaded a old version of easyWorker, let me check
from easyworker.
Ah no, the easyWorker.swc I pushed with the pull request is ok, just the sources are not pushed yet, was thinking to do it after my next demo.
Try it with that swc and tell me
from easyworker.
I used the swc you pushed on the test project. I forgot to update DBConf.getEnryptionKey signature and add the shareable property.
I got mx.collection.ArrayCollection class not found. Then I added "mx.collections.*" to extraDependencies and I am getting now
VerifyError: Error #1014: Class IMXMLObject could not be found.
Can you try using ArrayCollection in a thread please ?
from easyworker.
IMXMLObject ? Have you got any visual element in your worker ?
from easyworker.
Forget my last comment, I've got it, if you want to use classes from the SDK, especially big ones like ArrayCollection, easyWorker won't be able to detect private properties/method parameter and return type, only protected and public, tha's because as3-reflect doesn't know how to do it, you will need to import them from extraDependencies.
Btw, it is better to use light weight versions like Array in your worker to make it smaller.
from easyworker.
Any way, I tried with ArrayCollection and not found the same error but another one because as3common-reflect return a null return type at time, will try to find a workaround.
from easyworker.
I have an ArrayCollection in my Chapter model class. When I removed it I am getting another error :
got an Error in Run()Error #2004: One of the parameters is invalid. ArgumentError: Error #2004: One of the parameters is invalid.
at flash.system::MessageChannel/send()
at com.doublefx.as3.thread.util::ThreadRunner/dispatchResult()[F:\sources\easyWorker\API\src\main\flex\com\doublefx\as3\thread\util\ThreadRunner.as:284]
from easyworker.
Did you use the metatag [RemoteClass] in your model classes ?
from easyworker.
[RemoteClass] resolved the problem. I see it is because flex compiler create registerClassAlias for this metadata tag and it can be found in memory :)
The next challenge is using ArrayCollection in Worker.
from easyworker.
One of my goal creating this was to avoid what FB was doing creating workers, AKA duplicated your app in memory, there's a big overhead using worker, even with few code inside, so, IMO, it is better to keep it light and then prefer to use Array or custom classes inside of it
from easyworker.
No problem I will use Array then transform them to ArrayCollection after getting them from the Worker. Because I will loose data-binding with Array.
Another question, is it possible to create to create Flex components in a Worker then display them in a the main application ? Will it be against your goal creating easyWorker ?
from easyworker.
No, it is not possible, the workers haven't been implemented for anything relative to UI, so by extension, because ArrayCollection uses the Binding mechanism, SIngleton, ResourceManagerImpl, IMXMLObject, etc.. It shouldn't be used in a Worker
from easyworker.
Other limitations:
"Several runtime APIs are not available in code running in a background worker. These primarily consist of APIs related to user input and output mechanisms, or operating system elements like windows and dragging. As a rule, for any API that isn't supported in all contexts, use the isSupported, available, and similar properties to check whether the API is available in the background worker context before attempting to use the API.
Workers are useful because they decrease the chances of the frame rate dropping due to the main rendering thread being blocked by other code. However, workers require additional system memory and CPU use, which can be costly to overall application performance. Because each worker uses its own instance of the runtime virtual machine, even the overhead of a trivial worker can be large. When using workers, test your code across all your target platforms to ensure that the demands on the system are not too large. Adobe recommends that you do not use more than one or two background workers in a typical scenario."
from easyworker.
ANE's are not supported either
from easyworker.
Nice to know that. I am focusing to use workers only for time consuming database accesses, operations that takes 2 to 10 seconds in my application.
I am happy for you to close this issue after "some" comments.
from easyworker.
Thanks, it allowed me to discover and fix some bugs !!
from easyworker.
@santanu4ver The last Flex/AIR version can be found here http://www21.zippyshare.com/v/23305618/file.html
The PureAS3 here http://www77.zippyshare.com/v/37322487/file.html
from easyworker.
Hey Frédéric, appreciate your effort, downloading.
Thank you.
from easyworker.
the 4.13 download fails. anyone else having the same issue?
from easyworker.
You should use the installer 3.1
from easyworker.
from easyworker.
I just tried again and manually disconnected my internet and then reconnected... it seems there is no reconnection in place, so its possible there was a connection drop out, as another download I had going failed as well... regardless, I'll stop posting here seeing as it's somewhat off topic
from easyworker.
Related Issues (19)
- VerifyError: Error #1014: Class mx.core::DebuggableWorker could not be found. HOT 4
- [Fault] exception, information=TypeError: Error #1009: Cannot access a property or method of a null object reference. HOT 3
- Passed argument can't cast HOT 5
- Published application Issues HOT 3
- How can reuse a thred HOT 4
- optimize=false HOT 4
- ArrayCollection in worker HOT 1
- Worker seems to be processing [Embed] tags
- EasyWorker not working in projects using RSLs
- Problem running in Apache Flex 13.0 HOT 1
- Extracted ByteArray data from database set to null in result HOT 3
- Published application threads never return results HOT 8
- ReferenceError HOT 27
- thread.start(....) several times. HOT 5
- easyWorker and mobile (Android) HOT 8
- Posted download link for swc is broken HOT 6
- Not functioning while debugging from Flash Builder 4.0 HOT 4
- How to make plain function to be visible from within the worker? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyworker.