aboutsummaryrefslogtreecommitdiffstats
path: root/alv/base
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-09-04 09:26:39 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commitcce57208d5db4a539bcf10af09331a9ddd43f7ab (patch)
tree125c4189c10d282a99261783f1eac0809ec324b4 /alv/base
parentsupport :vis() on builtins (diff)
downloadalive-cce57208d5db4a539bcf10af09331a9ddd43f7ab.tar.gz
alive-cce57208d5db4a539bcf10af09331a9ddd43f7ab.zip
remove IOStreams, support optional polling in Ops
Diffstat (limited to 'alv/base')
-rw-r--r--alv/base/init.moon5
-rw-r--r--alv/base/input.moon8
-rw-r--r--alv/base/match.moon2
-rw-r--r--alv/base/op.moon12
4 files changed, 18 insertions, 9 deletions
diff --git a/alv/base/init.moon b/alv/base/init.moon
index 586a6bd..69979a5 100644
--- a/alv/base/init.moon
+++ b/alv/base/init.moon
@@ -16,7 +16,6 @@
-- @see Constant
-- @see SigStream
-- @see EvtStream
--- @see IOStream
-- @see type.T
-- @see type.Primitive
-- @see type.Array
@@ -30,7 +29,7 @@ import Builtin from require 'alv.base.builtin'
import FnDef from require 'alv.base.fndef'
import Input from require 'alv.base.input'
import const, sig, evt from require 'alv.base.match'
-import Constant, SigStream, EvtStream, IOStream from require 'alv.result'
+import Constant, SigStream, EvtStream from require 'alv.result'
import T, Primitive, Array, Struct from require 'alv.type'
import RTNode from require 'alv.rtnode'
import Error from require 'alv.error'
@@ -45,7 +44,7 @@ import Error from require 'alv.error'
-- redundant exports, to keep anything an extension might need in one import
-- Results
- :Constant, :SigStream, :EvtStream, :IOStream
+ :Constant, :SigStream, :EvtStream
-- Types
:T, :Primitive, :Array, :Struct
diff --git a/alv/base/input.moon b/alv/base/input.moon
index f29bd10..87e00de 100644
--- a/alv/base/input.moon
+++ b/alv/base/input.moon
@@ -2,7 +2,7 @@
-- Update scheduling policy for `Op` arguments.
--
-- @classmod Input
-import Constant, SigStream, EvtStream, IOStream from require 'alv.result'
+import Constant, SigStream, EvtStream from require 'alv.result'
import RTNode from require 'alv.rtnode'
inherits = (klass, frm) ->
@@ -112,9 +112,8 @@ class Input
-- Behaviour depends on what kind of `Result` `value` is:
--
-- - `Constant`: treated like `cold`.
- -- - `SigStream`: Marked dirty only if old and new `SigStream` differ.
- -- - `EvtStream` and `IOStream`: Marked dirty only if the current
- -- `EvtStream` is dirty.
+ -- - `SigStream`: Marked dirty only if old and new `result` differ.
+ -- - `EvtStream`: Marked dirty only if the current `result` is dirty.
--
-- This is the most common `Input` strategy.
--
@@ -152,7 +151,6 @@ mapping = {
[Constant]: ValueInput
[SigStream]: ValueInput
[EvtStream]: Input
- [IOStream]: IOInput
}
{
diff --git a/alv/base/match.moon b/alv/base/match.moon
index 4653107..f5fa99c 100644
--- a/alv/base/match.moon
+++ b/alv/base/match.moon
@@ -295,7 +295,7 @@ sig = setmetatable {}, {
__call: (...) => Type '~', ...
}
---- `Type` shorthands for matching `EvtStream` and `IOStream`s.
+--- `Type` shorthands for matching `EvtStream`s.
--
-- Call or index with a string to obtain an `Type` instance.
-- Call to obtain a wildcard pattern.
diff --git a/alv/base/op.moon b/alv/base/op.moon
index f20518d..bb48b09 100644
--- a/alv/base/op.moon
+++ b/alv/base/op.moon
@@ -112,6 +112,18 @@ class Op
else
{}
+ --- poll for external changes (optional).
+ --
+ -- If implemented, this method will be called at a high frequency and should
+ -- return `true` whenever processing is required due to an external event or
+ -- condition. After polling all such IO Ops a new tick will be executed if any
+ -- returned true. The implementation of `poll` is responsible for triggering
+ -- the `tick` method by writing to an internally allocated `Result` that has
+ -- been inserted into `inputs`.
+ --
+ -- @function poll
+ -- @treturn ?boolean dirty whether processing is required
+
--- implementation utilities.
--
-- super-methods and utilities for use by implementations.