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

Add is_closed and closed operations to Lwt_stream #223

Closed
wants to merge 10 commits into from
Closed

Add is_closed and closed operations to Lwt_stream #223

wants to merge 10 commits into from

Commits on Mar 13, 2016

  1. add is_closed to Lwt_stream.t

    Before this commit the Lwt_stream API provided no reliable way to detect
    if a stream had been closed. While on_termination notifies the user if
    the stream is closed in the future, it does not tell the user if the
    stream was closed in the past.
    
    Introducing the is_closed function addresses this problem, allowing the
    user to detect if a stream has been closed at any point in time.
    seliopou committed Mar 13, 2016
    Configuration menu
    Copy the full SHA
    d11b100 View commit details
    Browse the repository at this point in the history
  2. add closed to Lwt_stream.t

    This function returns a thread that will sleep until the stream is
    closed. The thread can be used in place of if_closed and on_terminate to
    detect when a stream is closed at any point in time.
    seliopou committed Mar 13, 2016
    Configuration menu
    Copy the full SHA
    c3e5aa3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b1fbc72 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2016

  1. do not call termination hooks in from_direct constructor

    The hooks will be called at the appropriate time once `f` finally
    returns `None`.
    seliopou committed May 2, 2016
    Configuration menu
    Copy the full SHA
    398b953 View commit details
    Browse the repository at this point in the history
  2. implement Lwt_stream.on_termination in terms of Lwt.closed

    As per the discussion on the issue tracker, Lwt_stream.on_termination
    will be deprecated and ultimately removed in favor for
    Lwt_stream.closed. To facilitate that, this commit introduces a new
    implementation of Lwt_stream.closed that does not rely on termination
    hooks, and implementation Lwt_stream.on_termination in terms of
    Lwt_Stream.closed.
    seliopou committed May 2, 2016
    Configuration menu
    Copy the full SHA
    c7918c0 View commit details
    Browse the repository at this point in the history
  3. deduplcate code with enqueue functions

    The Lwt_stream module had multiple copies of low-level enqueueing code
    of two varieties copied in serveral places.This commit moves one variety
    of enqueing code into a single function called enqueue', and implements
    the second variety as the function enqueue, in terms of enqueue'.
    seliopou committed May 2, 2016
    Configuration menu
    Copy the full SHA
    f2f4d3b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b9aed80 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2016

  1. change close semantics for fixed-length sources

    Previously, the of_list, of_array, and of_string constructors each would
    produce a stream s for which
    
      is_closed s = false
    
    This is counter-intuitive as all the elements of the stream s have been
    generated and should be consumable without blocking. This commit changes
    the behavior of this constructors such that
    
      is_closed s = true
    
    immediately upon creation.
    seliopou committed May 3, 2016
    Configuration menu
    Copy the full SHA
    47cd91f View commit details
    Browse the repository at this point in the history

Commits on May 4, 2016

  1. Configuration menu
    Copy the full SHA
    6aec9a6 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2016

  1. Revert "change close semantics for fixed-length sources"

    This reverts commit 47cd91f.
    seliopou committed May 5, 2016
    Configuration menu
    Copy the full SHA
    15001ef View commit details
    Browse the repository at this point in the history