sam-goodwin / eventual

Build scalable and durable micro-services with APIs, Messaging and Workflows
https://docs.eventual.ai
MIT License
174 stars 4 forks source link

feat: refactor call exec #415

Closed thantos closed 1 year ago

thantos commented 1 year ago

Work in progress, major refactor of calls and events within eventual.

Goals:

Out of Scope (but wanted)

Overview

graph TD
    UserCode --> Resource
    subgraph Core
        Resource --> Call
        Resource --> Property
    end
    subgraph Runtime
        Property --> PropertyRetrievers
        subgraph Worker
        Call --> WorkerExecutor
        end
        subgraph Workflow
        Call --> EventualFactory -->|Aka a Promise| Eventual
        Call -->|Transform| Event --> History
        Call -->|When the Call is New| WorkflowExecutor
        end
    end
    Workflow -->|Save/Load| Clients
    WorkerExecutor -->|Call| Clients
    WorkflowExecutor -->|Call and Add to Queue| Clients
    subgraph Environement
       Clients --> Cloud
       Clients --> Local
    end

Task List

Result

thantos commented 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.

thantos commented 1 year ago

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.

sam-goodwin commented 1 year ago

;) image