dgkf / dgkf/debugadapter

Using `{later}` to sync state

Open
#25 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
20
Forks
2
PR merge metrics
No merged PRs in 30d

Description

I've been exploring the use of `later` to repeatedly poll the debug adapter and synchronize state. This would alleviate one of my biggest concerns with this project currently, which is the lag time/expression for synchronization.

I think it's probably the way to go, but I need to really understand how to communicate between processes responsibly from a `later` callback. In naive tests it's raising an error when trying to reply back to the adapter.

```
Error in writeChar(content_str, x)
ignoring SIGPIPE signal
```

I _think_ this is because the connection to the adapter is captured in the closure that is passed to `later`, which as I understand it runs a callback in a separate background process. From what I know of multiprocess R, passing connection objects is always error prone, so I'm guessing it's related to this behavior.

I might need a separate socket connection just for the later callback, but that would probably mean that I need to be more mindful about routing responses.

@lionel- does this sound like a reasonably hypothesis for this error? Any behaviors I should avoid when dealing with multiprocess communication within a later callback?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.