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

WIP: Polling the parent process on Windows #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/iruby/kernel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,14 @@ def comm_close(msg)
private

def init_parent_process_poller
pid = ENV.fetch('JPY_PARENT_PID', 0).to_i
return unless pid > 1
parent_pid = ENV.fetch('JPY_PARENT_PID', 0).to_i

case RUBY_PLATFORM
when /mswin/, /mingw/
# TODO
interrupt_handle = Integer(ENV.fetch('JPY_EVENT_INTERRUPT', 0))
@parent_poller = start_parent_process_pollar_windows(parent_pid, interrupt_handle)
else
return unless parent_pid > 1
@parent_poller = start_parent_process_pollar_unix
end
end
Expand All @@ -202,5 +203,12 @@ def start_parent_process_pollar_unix
end
end
end

def start_parent_process_pollar_windows(parent_handle, interrupt_handle)
Thread.start do
IRuby.logger.warn("parent process poller thread started.")
# TODO
end
end
end
end