Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Fixes #198.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Drogalis committed Sep 9, 2015
1 parent b67bd82 commit dd581c9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### 0.7.4

- Allow functions in leaf position of a workflow. [#198](https://github.com/onyx-platform/onyx/issues/198)

#### 0.7.3

- Bug fix: Kill-job no longer throws a malformed exception with bad parameters.
Expand Down
14 changes: 14 additions & 0 deletions doc/user-guide/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This section outlines how Onyx programs execute behavior. Onyx uses plain Clojur
- [Continue Policy](#continue-policy)
- [Kill Policy](#kill-policy)
- [Bulk Functions](#bulk-functions)
- [Leaf Functions](#leaf-functions)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -138,3 +139,16 @@ And an example catalog function to correspond to this entry:
```

The default value for this option is `false`.

#### Leaf Functions

Sometimes you're going to want a node in your workflow with no outgoing connections that doesn't perform I/O against a database. You can do this by setting `:onyx/type` to `:output`, `:onyx/medium` to `:function`, and `:onyx/plugin` to `onyx.peer.function/function`. Then you can specify an `:onyx/fn` pointing to a regular Clojure function. For example:

```clojure
{:onyx/name :leaf-task
:onyx/fn ::add-to-results
:onyx/plugin :onyx.peer.function/function
:onyx/medium :function
:onyx/type :output
:onyx/batch-size 20}
```
3 changes: 1 addition & 2 deletions test/onyx/peer/leaf_function_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
:onyx/medium :function
:onyx/type :output
:onyx/batch-size batch-size
:onyx/max-peers 1
:onyx/doc "Writes segments to a core.async channel"}])
:onyx/max-peers 1}])

(def workflow [[:in :inc] [:inc :out]])

Expand Down

0 comments on commit dd581c9

Please sign in to comment.