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

Handle async data in registration function #13

Open
SomeKittens opened this issue Oct 22, 2015 · 1 comment
Open

Handle async data in registration function #13

SomeKittens opened this issue Oct 22, 2015 · 1 comment

Comments

@SomeKittens
Copy link
Owner

Registration functions may need to run async things before the registration is ready to go.

Example:

gustav.transformer('isSpam', iO => {
  // How do we return iO?
  natural.BayesClassifier.load('classifier.json', null, function(err, classifier) {
    // Subscribe to flow and run things past the classifier
  });
});
@SomeKittens
Copy link
Owner Author

One option is to return a new observable stream, and flatMap or somesuch so we can do some async task inside and emit our own Observable (which then emits data).

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

1 participant