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 execute-task to execute task and discard return value #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tmccombs
Copy link

This allows you to schedule a task without the overhead of needing to
keep track of the return value.

This allows you to schedule a task without the overhead of needing to
keep track of the return value.
@jorams
Copy link

jorams commented Feb 25, 2016

I would really like to see this merged. Right now I'm running a special worker just to keep the channel from accumulating endless amounts of return values.

@deadtrickster
Copy link

@jorams
Something like this also works

(lparallel.kernel::submit-raw-task
   (lparallel.kernel::make-task-instance
    (lambda ()
      (apply handler args))
    :cl-events)
   *kernel*)

@tmccombs
Copy link
Author

@deadtrickster but you have to use non-exported functions in that. And my change basically just exports a function that does that.

@lmj
Copy link
Owner

lmj commented Feb 26, 2016

Sorry for the delay. I think this is a good idea, though I'd prefer a name that makes it clearer what is happening -- maybe submit-untracked-task or submit-unchanneled-task or submit-task/no-channel? I'm open to suggestions. There could also be a trivial wrapper macro to match future syntax.

@lmj
Copy link
Owner

lmj commented Feb 27, 2016

I think I would go with submit-bare-task. There are complications with error handling which remind me that I've visited this issue before. The transfer-error restart, which is bound at the start of each worker, can't transfer an error since there is no channel. Hiding the restart inside a bare task seems like a bad idea because the user probably expects *debug-tasks-p* and (task-handler-bind ((error #'invoke-transfer-error)) ...) to work with bare tasks. Thus transfer-error should stay, yet not do what it is advertised to do. I suppose we tell users that in the context of a bare task transfer-error means transfer to oblivion.

@luismbo
Copy link

luismbo commented Feb 27, 2016

Random idea (that might give better ideas to someone else or make submit-bare-task look even better): submit-task-and-forget.

@mdbergmann
Copy link

Can't just a future be used for that purpose?

@tmccombs
Copy link
Author

A future needs to keep track of the result value. The purpose of this PR is to provide a way to schedule a task without needing the overhead of keeping the result value.

@mdbergmann
Copy link

In Java/Scala you can define a future like Future[Unit] which basically is a future without result.

Anyway. I don't want to interfere with this PR.
What's keeping it from getting merged?

@sabracrolleton
Copy link

What is keeping this from being merged?

@MonadMania
Copy link

Yes, I also want this behavior. I don't want to have to purge the channel of unwanted return values. Is anyone managing this repo? It looks dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants