Skip to content

Add execute-task to execute task and discard return value#22

Open
tmccombs wants to merge 2 commits into
lmj:masterfrom
tmccombs:execute-task
Open

Add execute-task to execute task and discard return value#22
tmccombs wants to merge 2 commits into
lmj:masterfrom
tmccombs:execute-task

Conversation

@tmccombs

Copy link
Copy Markdown

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

jorams commented Feb 25, 2016

Copy link
Copy Markdown

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
Copy Markdown

@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
Copy Markdown
Author

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

@lmj

lmj commented Feb 26, 2016

Copy link
Copy Markdown
Owner

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

lmj commented Feb 27, 2016

Copy link
Copy Markdown
Owner

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

luismbo commented Feb 27, 2016

Copy link
Copy Markdown

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
Copy Markdown

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

@tmccombs

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

What is keeping this from being merged?

@MonadMania

Copy link
Copy Markdown

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