Browse Source

Update README.md

pull/1/head
Fredrik Ekre 5 years ago committed by GitHub
parent
commit
e11cf00f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      README.md

10
README.md

@ -4,15 +4,19 @@ Simplify writing to multiple streams at once. @@ -4,15 +4,19 @@ Simplify writing to multiple streams at once.
## Usage
Construct a tee stream by wrapping multiple writable IO objects:
```julia
tee = TeeStream(io::IO...)
write(tee, ....)
close(tee) # calls close on all wrapped io
```
Construct a tee stream by wrapping multiple writable IO objects.
Construct a tee stream by wrapping multiple writable IO objects,
call function `f` on the tee, and automatically calls `close` on
all IO streams:
```julia
TeeStream(f::Function, io::IO...) do tee
# ...
write(tee, ...)
end
```

Loading…
Cancel
Save