Opened 13 years ago

Closed 12 years ago

#943 closed enhancement (duplicate)

remove sync behavior in DND

Reported by: ilia Owned by: Eugene Lazutkin
Priority: high Milestone: 0.9
Component: DnD Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by alex)

Currently, onDrop has to return immediate result. If it depends on server, then sync RPC call has to be done,but it locks everything and spoils architecture.

So it is suggested that onDrop should be async.

[23:51] <[algo]> I need to explicitly call methods
[23:51] <[algo]> onDrop need to return value
[23:51] <[algo]> true/false
[23:52] <[algo]> so in tree I had to use sync XMLHTTPRequests
[23:52] <slightlyoff> [algo]: uhh, well, folks can listen to those using events
[23:52] <[algo]> I suggested a variant where onDrop is async
[23:52] <slightlyoff> past that, I don't understand what you mean by "event based"
[23:52] <[algo]> it returns fast
[23:52] <slightlyoff> ok
[23:52] <[algo]> well, currently it does not return
[23:52] <[algo]> a moment I'll describe
[23:53] <slightlyoff> generally, it seems like what we want is  concrete set of DnD classes that we mix things into
[23:53] <[algo]> currently when user drops anything, onDrop is called and it may return success/failure. onDrop involves synchronous RPC call
[23:53] <slightlyoff> in lieu of the current inheritance structure
[23:54] <[algo]> maybe it'd be better to make onDrop async
[23:54] <slightlyoff> [algo]: you'd need another dropSuccess event or something
[23:54] <[algo]> it makes a call and locks up dndManager
[23:54] <slightlyoff> [algo]: or just use a Deferred
[23:54] <[algo]> (maybe)
[23:54] <[algo]> yeah
[23:54] <slightlyoff> [algo]: that's 'cause you're not connect()ing to it ;-)
[23:54] <[algo]> and when async comes back, it unlocks things
[23:55] <slightlyoff> [algo]: Ok, I'm cool with that
[23:55] <[algo]> that's the matter with current DND
[23:55] <slightlyoff> eh, it's one minor roblem
[23:55] <slightlyoff> you can wrap that onDrop in a deferred today if you want
[23:56] <[algo]> but its value is used
[23:56] <[algo]> its return value
[23:56] <slightlyoff> so lie = )
[23:56] <slightlyoff> return true
[23:56] <[algo]> ok I return true
[23:56] <[algo]> that means DND was ok
[23:56] <[algo]> and widgets process DND
[23:56] <slightlyoff> I understand the problem, though
[23:56] <[algo]> but server returns FALSE
[23:56] <[algo]> should I flicker whole screen red
[23:56] <[algo]> and say "oh jeez, guess failed :( reload app :("
[23:57] <[algo]> :)
[23:57] <[algo]> just in case someone will work with DND, should I put this dialogue into wiki ?
[23:57] <[algo]> (trac)
[23:59] <slightlyoff> yes, plesae
[23:59] <slightlyoff> I'm going to probably be working with Paul on an overhaul of DnD for 0.4 or 0.5
[00:00] <slightlyoff> it's way to hard to intercept various behaviors in DnD today

Change History (5)

comment:1 Changed 13 years ago by alex

Description: modified (diff)

comment:2 Changed 13 years ago by alex

Milestone: 0.4
Status: newassigned

comment:3 Changed 13 years ago by dylan

Milestone: 0.40.5
Version: 0.40.3

comment:4 Changed 12 years ago by Adam Peller

Component: GeneralDnD
Owner: changed from alex to Eugene Lazutkin
Status: assignednew

comment:5 Changed 12 years ago by Eugene Lazutkin

Resolution: duplicate
Status: newclosed

Dup of #373.

Note: See TracTickets for help on using tickets.