public synchronized void attach(final Stream<? extends T> stream) {
		requireNonNull(stream);

		synchronized (_lock) {
			if (_stream != null) {
				throw new IllegalStateException(
					"Already attached evolution stream."
				);
			}

			_stream = stream.takeWhile(e -> _proceed.get());
			_thread = new Thread(() -> {
				try {
					_stream.forEach(this::submit);
					close();
				} catch(CancellationException e) {
					Thread.currentThread().interrupt();
					close();
				} catch (Throwable e) {
					closeExceptionally(e);
				}
			});
			_thread.start();
		}
	}
Attaches the given stream to the publisher. This method automatically
starts the publishing of the elements read from the stream. The attached
{@code stream} is closed, when {@code this} publisher is closed.

@param stream the {@code stream} to attach
@throws NullPointerException if the given {@code stream} is {@code null}
@throws IllegalStateException if a stream is already attached to this
        publisher
jenetics/src/main/java/io/jenetics/util/StreamPublisher.java