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

[Feature] Support rx for piping #13

Open
eterna2 opened this issue Oct 29, 2020 · 0 comments
Open

[Feature] Support rx for piping #13

eterna2 opened this issue Oct 29, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@eterna2
Copy link
Contributor

eterna2 commented Oct 29, 2020

Piping can be achieved with rx.

Sample code:

import json

from iotoolz.rx import RxStream
from rx import operators as ops

source = RxStream("http://foo.bar/data.ndjson")

composed = source.pipe(
    ops.map(lambda line: json.loads(line)),
    ops.filter(lambda obj: "key" in obj)
)
composed.subscribe(lambda value: print("Received {0}".format(value)))
@eterna2 eterna2 added enhancement New feature or request help wanted Extra attention is needed labels Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant