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

withMonitor should provide monitor reference #273

Open
edsko opened this issue Feb 13, 2016 · 7 comments
Open

withMonitor should provide monitor reference #273

edsko opened this issue Feb 13, 2016 · 7 comments
Assignees
Labels
Projects
Milestone

Comments

@edsko
Copy link
Member

edsko commented Feb 13, 2016

Currently withMonitor is defined as

withMonitor :: ProcessId -> Process a -> Process a
withMonitor pid code = bracket (monitor pid) unmonitor (\_ -> code)

but it should be defined as

withMonitor :: ProcessId -> (MonitorRef -> Process a) -> Process a
withMonitor pid = bracket (monitor pid) unmonitor

Although it is possible, using the existing withMonitor, to wait for a MonitorNotification that matches the appropriate ProcessId, if another monitor exists for the same process ID then this may remove the wrong message from the process's mailbox.

@edsko edsko added the Bug label Feb 13, 2016
@hyperthunk
Copy link
Member

+1 - will need to trawl through the code base and fixup any occurrences that use the old API.

@hyperthunk hyperthunk self-assigned this Mar 1, 2016
@qnikst
Copy link
Contributor

qnikst commented Mar 10, 2016

Addressed by #279

@qnikst qnikst added this to the next minor milestone Mar 10, 2016
@qnikst qnikst assigned qnikst and unassigned hyperthunk Mar 10, 2016
@qnikst
Copy link
Contributor

qnikst commented Mar 10, 2016

I've added a new primitive to keep code backward compatible.

@hyperthunk
Copy link
Member

@edsko can we close this one off now? There are discussions underway about the naming of withMonitorRef or deprecating the old API (which I agree with), but either way there is now a solution that works.

@mboes
Copy link
Contributor

mboes commented Mar 11, 2016

There are discussions underway about the naming of withMonitorRef or deprecating the old API (which I agree with)

For reference, in #281.

@hyperthunk
Copy link
Member

@qnikst there seems to be an open/closed issue loop between this and #281, but I'm pretty sure the code has been merged to master a long time ago. Can we close now?

@qnikst
Copy link
Contributor

qnikst commented Nov 8, 2018

We can close this issue now, I don't easily see that #281 was merged, at least it's marked as open on github, but we can check while processing #281.

@hyperthunk hyperthunk added this to To do in Release 0.8 Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Release 0.8
  
Backlog
Development

No branches or pull requests

4 participants