diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-09-04 09:26:39 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | cce57208d5db4a539bcf10af09331a9ddd43f7ab (patch) | |
| tree | 125c4189c10d282a99261783f1eac0809ec324b4 /alv/result | |
| parent | support :vis() on builtins (diff) | |
| download | alive-cce57208d5db4a539bcf10af09331a9ddd43f7ab.tar.gz alive-cce57208d5db4a539bcf10af09331a9ddd43f7ab.zip | |
remove IOStreams, support optional polling in Ops
Diffstat (limited to 'alv/result')
| -rw-r--r-- | alv/result/base.moon | 7 | ||||
| -rw-r--r-- | alv/result/init.moon | 3 | ||||
| -rw-r--r-- | alv/result/io.moon | 55 |
3 files changed, 3 insertions, 62 deletions
diff --git a/alv/result/base.moon b/alv/result/base.moon index 734d614..a9a668d 100644 --- a/alv/result/base.moon +++ b/alv/result/base.moon @@ -1,7 +1,7 @@ ---- -- base Result interface. -- --- implemented by `Constant`, `SigStream`, `EvtStream`, and `IOStream`. +-- implemented by `Constant`, `SigStream`, and `EvtStream`. -- -- @classmod Result import Type from require 'alv.type' @@ -11,7 +11,7 @@ class Result --- Result interface. -- -- Methods that have to be implemented by `Result` implementations --- (`SigStream`, `EvtStream`, `IOStream`). +-- (`Constant`, `SigStream`, `EvtStream`). -- -- @section interface @@ -38,8 +38,7 @@ class Result --- the metatype string for this Result. -- - -- one of `=` (`Constant`), `~` (`SigStream`), - -- `!` (`EvtStream` and `IOStream`). + -- one of `=` (`Constant`), `~` (`SigStream`), `!` (`EvtStream`). -- -- @tfield string metatype diff --git a/alv/result/init.moon b/alv/result/init.moon index 200e4e1..8e5c64f 100644 --- a/alv/result/init.moon +++ b/alv/result/init.moon @@ -5,17 +5,14 @@ -- @see Constant -- @see SigStream -- @see EvtStream --- @see IOStream -- -- @module result import Constant from require 'alv.result.const' import SigStream from require 'alv.result.sig' import EvtStream from require 'alv.result.evt' -import IOStream from require 'alv.result.io' { :Constant :SigStream :EvtStream - :IOStream } diff --git a/alv/result/io.moon b/alv/result/io.moon deleted file mode 100644 index f68f672..0000000 --- a/alv/result/io.moon +++ /dev/null @@ -1,55 +0,0 @@ ----- --- Stream of external side-effects. --- --- Unlike other `Stream`s, this is not updated/set by an `Op` instace, but is --- continuously polled for changes by the runtime and may mark itself as --- *dirty* at any point in time. All runtime execution happens due to IOStream --- updates, which ripple through the `RTNode` tree. --- --- @classmod IOStream -import EvtStream from require 'alv.result.evt' - -class IOStream extends EvtStream ---- IOStream interface. --- --- methods that have to be implemented by `IOStream` implementations. --- @section interface - - --- construct a new IOStream. - -- - -- Must prepare the instance for `dirty` to be called. - -- The super-constructor should be called to set `Result.type`. - -- - -- @classmethod - -- @tparam type.Type type the type of this stream. - new: (type) => super type - - --- create a mutable copy of this stream. - -- - -- Used to wrap insulate eval-cycles from each other. - -- - -- @treturn IOStream - fork: => @ - - --- poll for changes. - -- - -- Called every frame by the main event loop to update internal state. - poll: => - - --- check whether this adapter requires processing. - -- - -- Must return a boolean indicating whether `Op`s that refer to this instance - -- via `Input.hot` should be notified (via `Op:tick`). May be called multiple - -- times. May be called before `poll` on the first frame after construction. - -- - -- If this is not overriden, the `EvtStream` interface can be used, see - -- `EvtStream.add`, `EvtStream.unwrap`, and `EvtStream.dirty`. - -- - -- @function dirty - -- @treturn bool whether processing is required - - __inherited: (cls) => cls.__base.__tostring or= @__tostring - -{ - :IOStream -} |
