Closed thantos closed 1 year ago
smart tree shaking in the future
To expand on this... if we know what resources or at least the imports of a single worker function, we know which clients/executors to include or exclude. Maybe pre-mature optimization, but just getting the groundwork for more dynamic dependency inclusion.
This was a good exercise, I found a bug that existed in workflow and not workers (open search) and a bug that existed in workers and not the workflow (bucket put with stream). The code is more shared now, should be an issue less often.
;)
Work in progress, major refactor of calls and events within eventual.
Goals:
Calls
required to fully support the system.ExecutionHandle
).Out of Scope (but wanted)
EntityRequestSucceeded
andEntityRequestFailed
withCallSucceeded
andCallFailed
).Overview
Call
- a named operation or group of operations that are defined within Eventual (ex:TaskCall - myTask()
). They may have a payload and may contain sub-operations within them for simplicity (ex:EntityRequest - myEntity.put/get
).Property
- a new concept representing synchronous value lookup. Like a Call, it may have a payload, but it must be synchronous from end to end. Examples are retrieving the BucketPhysicalName from a bucket, retrieve the open search client, or just get the service name in a uniform way.Client/Store
- an interface or class that defines how to invoke real resources like AWS.EntityClient.put("myEntityName", ...params)
Calls
orProperties
and returns promises or values. Registered by the system, for example the workflow executor or the entity worker.Worker and Orchestrator/Workflow
- A general term for a unique wrapper around user logic. For example, the Entity Stream Worker executes user logic when an Entity Stream event is triggered. It must bring with it real clients and deliver call to the correct client. The workflow Orchestrator is like a worker, but more special, it captures allCalls
while executing the workflow, turns them into events, compares them to past events, and then only calls clients when necessary.Executor
an executor is a discrete piece of logic or logics that handles aCall
. In come cases it maps the call to it'sClient
or it may map a Call to events/tasks for a workflow. Each worker must provide an Executor for each call, even if it is to say the call is unsupported. Executors can be composed with one another or wrap other executors. They are typesafe.EventualHook
an interface accessible to user space code (core) that allows executing calls and retrieving properties. This interface is replaced incore-runtime
as needed, generally with Executors and PropertyRetrievers.Task List
EventualHook
.Calls
(existing) toExecutors
(new)enterEventualHook
scope with locally defined executors.CallEvent
(still has a sub-type)ExecutionHandle
returned byStartWorkflow
SHOULD work within a workflowResult