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

Pass a state through the continuations in all cases #73

Closed
harendra-kumar opened this issue May 10, 2018 · 2 comments
Closed

Pass a state through the continuations in all cases #73

harendra-kumar opened this issue May 10, 2018 · 2 comments
Labels
type:enhancement User visible feature

Comments

@harendra-kumar
Copy link
Member

Currently we pass the SVar state only when needed. SVar is a specific state that we need in specific cases. However we need a generalized state passing for configuration type combinators to work. The SVar state could be a subset of the general state that is always passed.

We may need combinators like the following, that can be implemented using a general state passing:

  • trace - to trace the threads created and deleted by the stream
  • buffer - to specify the size of the buffer to be used on producer side
  • threads - to specify a limit of the worker threads on the producer side

Other than implementing the combinators using the internal state passing, as an experimental thought, the same state passing functionality can be used to implement a state monad functionality in streamly itself. Even though a StateT can be used, it may be more efficient and beginner friendly to have integrated get/put.

@harendra-kumar
Copy link
Member Author

For tracing some useful functionality can be:

  • Diagnostics - for each SVar print how much time an action is taking on
    average and then suggest whether the parallelism is useful or not, so that the
    user can use appropriate combinators. it should print the source line, the
    Streamly API name and the timings.
  • Print total number of SVars and threads and threads per SVar etc under a
    given tree.

@harendra-kumar
Copy link
Member Author

This is fixed via commit 211df79. New issues raised for tracing and State monad integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement User visible feature
Projects
None yet
Development

No branches or pull requests

1 participant