Changing DWR to use deferred

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing DWR to use deferred

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Changing DWR to use deferred

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Changing DWR to use deferred

david@butterdev.com
Anything is possible.  I would recommend relying on an existing implementation such as JQuery.  You can then look at the JQuery ajax function to see how  it is used.  Then you would need to modify engine.js in a similar manner.  JQuery essentially has one huge ajax function where ours is split up.  You will probably need to place the deferred in the batch to resolve it properly (in handleCallback, etc.).  If you would create a new feature request Jira for this that would be great.  I don't think we would be able to address is soon but it would be nice to have in the queue. 

-David

 
On 03/22/2014 01:59 PM, Jamie Johnson wrote:
Sorry, I misspoke, I didn't mean synchronous I just meant to make DWR use deferred vs the callback mechanisms it uses now.


On Sat, Mar 22, 2014 at 3:57 PM, Jamie Johnson <[hidden email]> wrote:
Is it possible to make DWR use deferred vs the synchronous calls?  It appears that this would make things play nicer with frameworks like CanJS, Angular, etc. Any thoughts/opinions on how to do this would be appreciated.

-Jamie


Reply | Threaded
Open this post in threaded view
|

Re: Changing DWR to use deferred

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Changing DWR to use deferred

david@butterdev.com
https://directwebremoting.atlassian.net/

On 03/25/2014 03:45 PM, Jamie Johnson wrote:

Sure, will do.  What's the address to jira?

On Mar 22, 2014 6:38 PM, "David Marginian" <[hidden email]> wrote:
Anything is possible.  I would recommend relying on an existing implementation such as JQuery.  You can then look at the JQuery ajax function to see how  it is used.  Then you would need to modify engine.js in a similar manner.  JQuery essentially has one huge ajax function where ours is split up.  You will probably need to place the deferred in the batch to resolve it properly (in handleCallback, etc.).  If you would create a new feature request Jira for this that would be great.  I don't think we would be able to address is soon but it would be nice to have in the queue. 

-David

 
On 03/22/2014 01:59 PM, Jamie Johnson wrote:
Sorry, I misspoke, I didn't mean synchronous I just meant to make DWR use deferred vs the callback mechanisms it uses now.


On Sat, Mar 22, 2014 at 3:57 PM, Jamie Johnson <[hidden email]> wrote:
Is it possible to make DWR use deferred vs the synchronous calls?  It appears that this would make things play nicer with frameworks like CanJS, Angular, etc. Any thoughts/opinions on how to do this would be appreciated.

-Jamie



Reply | Threaded
Open this post in threaded view
|

Re: Changing DWR to use deferred

Mike Wilson
Administrator
In reply to this post by david@butterdev.com
This is a great suggestion. I think it would be even better to enable any form of general Promise. Promises are being standardized in ES6 and jQuery's Deferred is something similar.
 
Btw, it's possible to augment DWR without actually changing engine.js, by patching the dwr.engine namespace after loading, ie:
    <script src="dwr/engine.js"></script>
    <script src="myaugment.js"></script>
If you show me how you want to change the call semantics then I can show you how to do the augmentation.
 
Best regards
Mike Wilson
 
David Marginian wrote:
Anything is possible.  I would recommend relying on an existing implementation such as JQuery.  You can then look at the JQuery ajax function to see how  it is used.  Then you would need to modify engine.js in a similar manner.  JQuery essentially has one huge ajax function where ours is split up.  You will probably need to place the deferred in the batch to resolve it properly (in handleCallback, etc.).  If you would create a new feature request Jira for this that would be great.  I don't think we would be able to address is soon but it would be nice to have in the queue. 

-David

 
On 03/22/2014 01:59 PM, Jamie Johnson wrote:
Sorry, I misspoke, I didn't mean synchronous I just meant to make DWR use deferred vs the callback mechanisms it uses now.


On Sat, Mar 22, 2014 at 3:57 PM, Jamie Johnson <[hidden email]> wrote:
Is it possible to make DWR use deferred vs the synchronous calls?  It appears that this would make things play nicer with frameworks like CanJS, Angular, etc. Any thoughts/opinions on how to do this would be appreciated.

-Jamie