Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    1
    Vote Rating
    1
    Debug is on a distinguished road

      1  

    Default Promises and Deferreds/Futures in Ext JS?

    Promises and Deferreds/Futures in Ext JS?


    Hi All,

    I've utilized Promises/Futures in Boost for C++ and have tried out the equivalent, Promises/Deferreds, in the Dojo Toolkit. I've looked around for something similar in Ext JS but haven't found something yet. I'm still new to Ext JS though so I could have missed it. Any pointers?

    Thanks,
    Bill

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,667
    Vote Rating
    110
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    hi bill,

    i am not familiar with dojo, but it looks like callbacks to me.

    take a look at:
    http://docs.sencha.com/ext-js/4-0/#/api/Ext.Function

    there is a createSequence for example.

    generally, ext is extremely event-driven (observer pattern) and it is prefered to listen to common events and then do your logic instead of creating chains manually.

    http://docs.sencha.com/ext-js/4-0/#/...til.Observable
    is included in every component and you can listen to render for example.
    you can also fire custom events to listen to.


    best regards
    tobiu
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2011
    Location
    Saarbrücken, Germany
    Posts
    11
    Vote Rating
    0
    s.busch is on a distinguished road

      0  

    Default


    @tobiu Callbacks are not the same.

    Deferreds/promises (aka. Futures) and accompanying tools help managing asynchronous logic, for example when you are waiting for two or more different stores are loaded (in the FuturesJS library this would be a Join with two or more Futures)

    Another example: you want to fire some requests in a fixed sequence which must not overlap (ok, you can accomplish this with nested callbacks, but a large sequence results in a deeply nested logic). Using things like Sequence (FuturesJS library) hide this complexity and help making code with a simpler structure. Ext JS createSequence() to my knowledge doesn't work asynchronously.

    We think Ext JS should provide support for this out-of-the box. It helps a lot for some complex tasks and it's hard to apply this to Ext JS by ourselves by adding external libraries and the integration is suboptimal.

    Libraries:

    Sebastian

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    All those pages seem quite opaque in what actually happens.

    Can you post some possible example of what you would like to happen?

  5. #5
    Sencha User
    Join Date
    May 2007
    Location
    Germany
    Posts
    73
    Vote Rating
    1
    AlxH is on a distinguished road

      0  

    Default


    I think its about how to sync multiple async-operations .
    For example you've got a form with textfields and two grids in it. So you would first load the form and the two gridstores. When all three load-operations are complete you would like to do something - enable the submit button for example.
    What is the best practice to accomplish this kind of task?

    I guess this is a quite common problem in real-world applications...

  6. #6
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    227
    Vote Rating
    1
    alphadogg is on a distinguished road

      0  

    Default


    Why would Sencha have to provide this? I agree that it'd be interesting if it were rolled in, but quite frankly, they need to fix the current shop before opening a new one...

  7. #7
    Sencha Premium Member
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    48
    Vote Rating
    3
    extjs@kingsquare.nl is on a distinguished road

      1  

    Default


    I really agree with @s.busch here: this should really be part of the ExtJs in the nearest possible future. It's not a 'new shop', it's a technique that could simplify, prettify and optimize eventhandling between objects

    A nice, pretty much stand-alone example of how it could be implemented can be found here https://github.com/mozilla/pdf.js/bl...er/src/util.js (around line 412)

    An very simple example of how it could be used can be found here:
    https://github.com/mozilla/pdf.js/bl...ter/src/api.js (around line 20)

    As you can see, two operations take place at the same time: a web worker process is set up (asynchroneus) while a pdf File is being downloaded (asynchroneus). Both tasks need to be done, before the 'real' PDF rendering can take place. The asynchronous processes are started and monitored in another function and scope. We could set up some spaghetti Event Listener structure, but in this case there is made a promise that the processes will be executed. Without knowing how and where the promise will be forefilled, we can still be sure that some other function will only run after that has been done. This might be as a callback-like function, or straight away because the promise is already forefilled...

    Other JavaScript frameworks (like jquery) have adopted this principle too.

  8. #8
    Sencha User
    Join Date
    May 2008
    Posts
    3
    Vote Rating
    0
    utyf is on a distinguished road

      0  

    Default


    +1

    Promises are really a good feature.

  9. #9
    Sencha Premium Member
    Join Date
    Jun 2012
    Location
    Auckland, New Zealand
    Posts
    6
    Vote Rating
    1
    walter.rumsby is on a distinguished road

      0  

    Default


    DeftJS - https://github.com/deftjs/DeftJS - provides a number of extensions for Ext, including Promises and Deferreds.

  10. #10
    Sencha User
    Join Date
    Mar 2009
    Location
    Fort Worth, TX
    Posts
    65
    Vote Rating
    -36
    jemptymethod is infamous around these parts jemptymethod is infamous around these parts jemptymethod is infamous around these parts jemptymethod is infamous around these parts jemptymethod is infamous around these parts

      0  

    Default


    Quote Originally Posted by extjs@kingsquare.nl View Post
    As you can see, two operations take place at the same time: a web worker process is set up (asynchroneus) while a pdf File is being downloaded (asynchroneus). Both tasks need to be done, before the 'real' PDF rendering can take place. The asynchronous processes are started and monitored in another function and scope. We could set up some spaghetti Event Listener structure
    No need for a "spaghetti Event Listener structure": see: http://code.google.com/p/sendall/ It's by no means a complete framework but as you can see, it is built around a traditional design pattern (command object) and Javascript closures.