Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenge 4.1 should be clarified, solution/test possibly changed #10

Closed
KevinGreene opened this issue Sep 25, 2015 · 6 comments
Closed

Comments

@KevinGreene
Copy link
Contributor

This is partially referenced in #5, but I think during the workshop it was misdiagnosed.

In the test file, it says:

;; In this challenge, we're going to log every segment that
;; we see after it's processed by the :times-three task with
;; the lifecycle hook :after-batch. Obtain the segments via
;; the key :onyx.core/batch in the event map.

I believe this should say :onyx.core/results, as it is asking for the results after it has been processed, which should indicate that :onyx.core/batch shouldn't be used.

However, this propagated to the test / solutions files as well, as the test rebuilds the input instead of using the expected output here - https://github.com/onyx-platform/learn-onyx/blob/master/test/workshop/jobs/test_4_1.clj#L47

The solution also uses :onyx.core/batch to make the tests pass as well, seen here - https://github.com/onyx-platform/learn-onyx/blob/answers/src/workshop/challenge_4_1.clj#L53

I'd be happy to change this and submit a PR, but should the change be reworking the test, solution, and hints to use :onyx.core/results, or should it be reworking the prompt to simply say "every segment that we see before it's processed..."?

@MichaelDrogalis
Copy link
Contributor

@KevinGreene I clarified this to simply use batch, and log before processing. Thanks - we'll add a better explanation of lifecycles when we close #5. We really appreciate the feedback!

@neverfox
Copy link

Yeah, there's still something unclear about this one. I was moving along smoothly until I got to 4-1. There were two things that I think still need fixing:

  1. A minor thing, but the placeholders in the source file for log-segments and logger-lifecycle are in the wrong order. If you actually write them in that order, you'd get an error for an unresolved symbol.
  2. It wasn't clear that you actually have to get the :message key off of the map returned by :onyx.core/batch. I eventually figured that out by examining some of the test results but I don't know how much you want this to be an exercise in Clojure debugging vs. focusing on Onyx concepts.

@MichaelDrogalis
Copy link
Contributor

@neverfox I'll take another shot at this one this afternoon, thanks for the report!

@neverfox
Copy link

@MichaelDrogalis Thanks! This is a fantastic tutorial. If only every library came with something like this.

@MichaelDrogalis
Copy link
Contributor

@neverfox Thank you! :) I really appreciate that.

@MichaelDrogalis
Copy link
Contributor

@neverfox Updated master and answers with commit 38e8fa9. Reopen if you think this is still unclear.

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

No branches or pull requests

3 participants