GithubHelp home page GithubHelp logo

Comments (52)

santanu4ver avatar santanu4ver commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

GhaziTriki avatar GhaziTriki commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

GhaziTriki avatar GhaziTriki commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

It is very late already here, will test it tomorrow night though !

from easyworker.

doublefx avatar doublefx commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

santanu4ver avatar santanu4ver commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

@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.

doublefx avatar doublefx commented on August 18, 2024

@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.

santanu4ver avatar santanu4ver commented on August 18, 2024

Thanks Frédéric, looking forward to the new updates.

from easyworker.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

@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.

doublefx avatar doublefx commented on August 18, 2024

@santanu4ver In between you can get the Flex/AIR one here https://github.com/doublefx/easyWorker-ActiveAIRCord/tree/c98f0abb15a91134d99a8358f9604b82741b2b58/libs

from easyworker.

doublefx avatar doublefx commented on August 18, 2024

@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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

It looks like I'm taking more job :-)
Thanks.

from easyworker.

 avatar commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

I guess I uploaded a old version of easyWorker, let me check

from easyworker.

doublefx avatar doublefx commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

IMXMLObject ? Have you got any visual element in your worker ?

from easyworker.

doublefx avatar doublefx commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

Did you use the metatag [RemoteClass] in your model classes ?

from easyworker.

 avatar commented on August 18, 2024

[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.

doublefx avatar doublefx commented on August 18, 2024

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.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

ANE's are not supported either

from easyworker.

 avatar commented on August 18, 2024

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.

doublefx avatar doublefx commented on August 18, 2024

Thanks, it allowed me to discover and fix some bugs !!

from easyworker.

doublefx avatar doublefx commented on August 18, 2024

@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.

santanu4ver avatar santanu4ver commented on August 18, 2024

Hey Frédéric, appreciate your effort, downloading.

Thank you.

from easyworker.

peteshand avatar peteshand commented on August 18, 2024

the 4.13 download fails. anyone else having the same issue?
4 13_fail

from easyworker.

doublefx avatar doublefx commented on August 18, 2024

You should use the installer 3.1

from easyworker.

peteshand avatar peteshand commented on August 18, 2024

nope, still no good :/
capture

from easyworker.

peteshand avatar peteshand commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.