             @parent?._stream.emit('close scope', order:idx+1)
         @parent?._stream.release()
 
+    do_job: ({job}) =>
+        return unless job
+        if @stream.paused
+            @stream.queue.push(job)
+        else
+            do job
+
     emit: ->
         @order.emit(arguments...)
 
     write: (job) ->
-        # no self closing tags please
-        @release() if @children and @isnext
-        @emit 'entry', {job, order:(++@children)}
+        payload = {job, order:(++@children)}
+        if @stream.paused
+            # no self closing tags please
+            @stream.queue.push(@release) if @children > 1 and @isnext
+            # delay until stream resumes
+            @stream.queue.push(@emit.bind(this, 'entry', payload))
+        else
+            # no self closing tags please
+            @release() if @children > 1 and @isnext
+            @emit 'entry', payload
 
     release: () =>
         return if @released

            @template.on(event, this["on#{event}"].bind(this))

    write: (data) ->
        @stream.emit('data', data) if data

    close: () =>
        @builder.closed = yes
        @stream.emit 'end'

    # eventlisteners


        unless parent.writable
            console.warn "creating #{el.toString()} in closed #{parent.toString()} omitted"
            return
        el._stream = new Entry this, el, parent
        @opened_tags++
        el._stream.write =>
            return if el is el.builder
