def set_and_notify(value)
      @mutex.synchronize do
        @value = value

        @observers.each do |observer, persistent|
          if !observer.alive?
            debug { "dead: #{observer}" }

            @observers.delete(observer)

          elsif !persistent
            debug { "notify and drop: #{observer} <- #{value}" }

            observer << Message.new(observer, self, value)

            @observers.delete(observer)

          else
            debug { "notify: #{observer} <- #{value}" }

            observer << Message.new(observer, self, value)
          end
        end
      end
    end
def set_and_notify(value)
      @mutex.synchronize do
        @value = value

        @observers.each do |observer, persistent|
          if !observer.alive?
            debug { "dead: #{observer}" }

            @observers.delete(observer)

          elsif !persistent
            debug { "notify and drop: #{observer} <- #{value}" }

            observer << Message.new(observer, self, value)

            @observers.delete(observer)

          else
            debug { "notify: #{observer} <- #{value}" }

            observer << Message.new(observer, self, value)
          end
        end
      end
    end
Send Message with given value to each Kontena::Observer that is still alive.
 Future calls to `add_observer` will also return the same value.
 Drops any observers that are dead or non-persistent.

 TODO: automatically clean out all observers when the observable crashes?

 @param value [Object, nil, Exception]