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

[io] Refactor of ThreadIO #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 30, 2021

  1. [io] Refactor of ThreadIO

    The ThreadIO service replaces the System streams so that the output and input on a thread associated with a command can be captured.
    
    Unfortunately, this occupies the singletons of System.in/out/err. There are many others that want to use the same mechanism.
    
    This change introduces a SystemIO service that dispatches the System streams to any number of listeners. The ThreadIO is modified to use this service.
    
    By default, the Gogo runtime will register its own SystemIO service. However, it is possible to disable this with the "org.apache.felix.gogo.systemio.timeout" (SystemIO.TIMEOUT) framework property. If this is set to a numeric value, it will indicate that Gogo should look for an external service. The numeric value indicates the amount of time Gogo should wait for this service. 30000 is a common value. 
    
    Additionally, there is an onClose method added to the session so that it is possible to get a callback when the session closes. Gogo commands can use this to cancel any activity related to a session. The lambda is weakly referenced so it is necessary that the command keeps a strong reference to the callback.
    
    Signed-off-by: Peter Kriens <[email protected]>
    pkriens committed Mar 30, 2021
    Configuration menu
    Copy the full SHA
    f55963e View commit details
    Browse the repository at this point in the history