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

Construct for async actions that don't produce values #660

Closed
ldaley opened this issue Apr 27, 2015 · 5 comments
Closed

Construct for async actions that don't produce values #660

ldaley opened this issue Apr 27, 2015 · 5 comments
Assignees

Comments

@ldaley
Copy link
Member

ldaley commented Apr 27, 2015

We have Promise for asynchronously produced single value, and Publisher for multi values. We are missing a construct for an async action that produces no values.

Options:

  1. We go with Promise
  2. ExecControl.nest(Block someAction, Block then)
  3. Introduce AsyncAction, which is like Promise, but no operations

For 2, the caller of the action would have to no it was async and act accordingly (i.e. no type safety).

For 3, the implementor has to return the code, instead of just doing it. That’s a bit of a pain. In that respect, it’s no different to 1 though.

@niwinz
Copy link
Contributor

niwinz commented May 2, 2015

In my opinion, the Promise<Void> should be used. Having different types for the same purpose but with different value (or absense of value) does not have benefits, but having only one type, has the benefit that the user should not think about different kind of types.

@ldaley
Copy link
Member Author

ldaley commented May 2, 2015

The big downside to the Promise<Void> approach though is that you have null flying all over the place. It is looking like the most promising option though at this point.

ldaley added a commit that referenced this issue May 29, 2015
@ldaley ldaley added this to the pre-1.0 milestone May 30, 2015
@danhyun
Copy link
Member

danhyun commented Jun 15, 2015

Is this not addressed via Operation now?

@ldaley
Copy link
Member Author

ldaley commented Jun 15, 2015

It is, but the class needs some docs.

On 15 Jun 2015, at 05:54, Danny notifications@github.com wrote:

Is this not addressed via Operation now?


Reply to this email directly or view it on GitHub.

@danhyun
Copy link
Member

danhyun commented Jun 15, 2015

Got it, I can tackle tonight.

@ldaley ldaley modified the milestones: release-0.9.18, pre-1.0 Jun 18, 2015
@ldaley ldaley self-assigned this Jun 18, 2015
@ldaley ldaley closed this as completed Jun 18, 2015
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

No branches or pull requests

3 participants