Dever v0.0.2
This commit is contained in:
commit
e6e175ebcf
816 files changed
+120349
No files matched your search
@@ -0,0 +1,48 @@
|
||||
rule bytes(event: dever.io.ReadEvent) (out: Bytes)
|
||||
| event | out |
|
||||
| Chunk(value) | value |
|
||||
| Failed(message) | fail(dever.io.ReadEvent.Failed(message)) |
|
||||
|
||||
loop first(values: Stream<dever.io.ReadEvent>) (out: Bytes?)
|
||||
| each value in values | result |
|
||||
| out | first bytes(value) |
|
||||
|
||||
loop all(values: Stream<dever.io.ReadEvent>) (out: List<Bytes>)
|
||||
| each value in values | result |
|
||||
| out | list bytes(value) |
|
||||
|
||||
loop overflow(values: Stream<dever.io.ReadEvent>, base: Int) (out: Int)
|
||||
| each value in values | result |
|
||||
| out | sum length(bytes(value)) + base |
|
||||
|
||||
loop summary(values: Stream<dever.io.ReadEvent>) (first: Bytes?, rest: List<Bytes>)
|
||||
| each value in values | result |
|
||||
| first | first bytes(value) |
|
||||
| rest | list bytes(value) |
|
||||
|
||||
loop zero(values: Stream<dever.io.ReadEvent>) (out: List<dever.io.ReadEvent>)
|
||||
| each value in values | take | result |
|
||||
| out | 0 | list value |
|
||||
|
||||
flow closeOnly(values: Stream<dever.io.ReadEvent>) ()
|
||||
| step | kind | do |
|
||||
| - | calc | close(values) |
|
||||
|
||||
flow chunks(file: dever.system.File, size: Int) (out: Stream<dever.io.ReadEvent>)
|
||||
| step | kind | do |
|
||||
| out | flow | dever.io.chunks(file, size) |
|
||||
|
||||
flow collect(path: Text, size: Int) (out: List<Bytes>)
|
||||
| step | kind | do |
|
||||
| file | flow | dever.io.open(path) |
|
||||
| stream | flow | chunks(file, size) |
|
||||
| out | loop | all(stream) |
|
||||
|
||||
flow offload(path: Text, size: Int) (out: List<Bytes>)
|
||||
| step | kind | do |
|
||||
| out | calc | blocking(collect(path, size)) |
|
||||
|
||||
flow spawned(path: Text, size: Int) (out: List<Bytes>)
|
||||
| step | kind | do |
|
||||
| task | calc | run(collect(path, size)) |
|
||||
| out | calc | wait(task) |
|
||||
Reference in new issue
Block a user