Skip to content

Unify execute() and fork()#14

Merged
cowboyd merged 1 commit intomasterfrom
unify-fork-and-execute
Oct 18, 2019
Merged

Unify execute() and fork()#14
cowboyd merged 1 commit intomasterfrom
unify-fork-and-execute

Conversation

@cowboyd
Copy link
Copy Markdown
Member

@cowboyd cowboyd commented Oct 18, 2019

With fork() now being a static function, and operations all being atoms that don't have arguments, the signature for fork() and execute() became exactly the same:

fork(operation) => Execution
execute(operation) => Execution

It wasn't hard to see that execute was nothing more than a "root" fork. Or a just fork that had no existing context, so it made it much more conceptually simple to eliminate one in favor of the other.

This removes the execute function altogether, and adds a base case to fork() where if the current execution is not defined, it creates a brand new execution to serve as the root context.

With `fork()` now being a static function, and operations all being
atoms that don't have arguments, the signature for `fork()` and
`execute()` became exactly the same:

```ts
fork(operation) => Execution
execute(operation) => Execution
```

It wasn't hard to see that `execute` was nothing more than a "root"
fork. Or a just fork that had no existing context, so it made it much
more conceptually simple to eliminate one in favor of the other.

This removes the `execute` function altogether, and adds a base case
to `fork()` where if the current execution is not defined, it creates
a brand new execution to serve as the root context.
@frontsidejack
Copy link
Copy Markdown
Member

A preview package of this pull request has been released to NPM with the tag unify-fork-and-execute.
You can try it out by running the following command:

$ npm install effection@unify-fork-and-execute

or by updating your package.json to:

{
  "effection": "unify-fork-and-execute"
}

Once the branch associated with this tag is deleted (usually once the PR is merged or closed), it will no longer be available. However, it currently references effection@0.2.0-bed72bd which will be available to install forever.

Generated by 🚫 dangerJS against 657660c

@cowboyd cowboyd merged commit 8ab934e into master Oct 18, 2019
@cowboyd cowboyd deleted the unify-fork-and-execute branch October 18, 2019 22:27
@cowboyd cowboyd mentioned this pull request Oct 18, 2019
jnicklas added a commit that referenced this pull request Feb 24, 2021
taras pushed a commit that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants