PaulUithol/Backbone-relational — pull request #350 by AsaAyers (2013-05-24 20:43:46+00:00)
Title: Backbone.BlockingQueue.process() copies/resets the queue before proceing

This maintains the originally intended order of events when process gets
called more than once.

Previous Behavior
=================

process() starts with events ['A1', 'A2', 'A3']. A handler of 'A2' calls
.set() on a model, this ends up queuing 'B1' and 'B2'.

The end of that .set() call starts processing and runs 'A3', 'B1', 'B2'.

final result 'A1', 'A2', 'A3', 'B1', 'B2'

New Behavior
============

process() starts with events ['A1', 'A2', 'A3']. A handler of 'A2' calls
.set() on a model, this ends up queuing 'B1' and 'B2'.

The end of that .set() call starts processing and runs 'B1', 'B2'. When
the call stack gets back to the first process() it runs 'A3'

final result 'A1', 'A2', 'B1', 'B2', 'A3'
If the events didn't have to be queued, this is the order they would
have fired in.