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

Promises and Expectations #30

Closed
ramontayag opened this Issue Apr 10, 2014 · 12 comments

Comments

Projects
None yet
4 participants
@ramontayag
Copy link
Contributor

ramontayag commented Apr 10, 2014

@adomokos, I saw an internal tool used at Github that is a lot like LightService. One nice they had was this notion of Promises and Expectations. Used the following way:

class FrothMilk
  include LightService::Action
  expects :milk, :cup
  promises :frothed_milk_in_cup

  executed {...}
end

You can immediately tell what this action is expects from the context, and what this action promises to set in the context. An organizer would find this useful because it can see the chain of actions and check if they're compatible by looking at the expectations and promises.

What do you think? Would you like this included in LightService?

@adomokos

This comment has been minimized.

Copy link
Owner

adomokos commented Apr 10, 2014

Love it!! Can I have it please?! ❤️

@ramontayag

This comment has been minimized.

Copy link
Contributor

ramontayag commented Apr 10, 2014

Yeah sure I can work on it :) Wanted to bring it up first.

@padi

This comment has been minimized.

Copy link
Contributor

padi commented Apr 10, 2014

👍

1 similar comment
@ngpestelos

This comment has been minimized.

Copy link
Contributor

ngpestelos commented Apr 10, 2014

👍

@adomokos

This comment has been minimized.

Copy link
Owner

adomokos commented Apr 16, 2014

I am thinking about working on this unless you have already started.

@ramontayag

This comment has been minimized.

Copy link
Contributor

ramontayag commented Apr 16, 2014

Hi I won't be able to start until the weekend hits. Busy past week. :-)
sure you can start of you really want it already hehe.

Sent from my phone
On 16 Apr 2014 22:45, "Attila Domokos" notifications@github.com wrote:

I am thinking about working on this unless you have already started.


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-40607397
.

@adomokos

This comment has been minimized.

Copy link
Owner

adomokos commented Apr 25, 2014

This is coming after I thoroughly test it: https://github.com/adomokos/light-service#expects-and-promises Can I close this issue?

@ramontayag

This comment has been minimized.

Copy link
Contributor

ramontayag commented Apr 25, 2014

Nice! I like the addition of the writer method for promises.

Before we close it, how do you suggest we approach checking compatibility of actions?

@adomokos

This comment has been minimized.

Copy link
Owner

adomokos commented Apr 25, 2014

A thorough testing would be appreciated.
Change your gemfile to this:

gem 'light-service', :github => 'adomokos/light-service', :branch => 'master'

Let me know if you bump into anything. Thank you!

@ngpestelos

This comment has been minimized.

Copy link
Contributor

ngpestelos commented Apr 27, 2014

Hi,

I was able to use this just now and it works! Actions are much more shorter, now that the manual checks have been removed.

Thank you for writing this!

👍

@adomokos

This comment has been minimized.

Copy link
Owner

adomokos commented Apr 27, 2014

Sure thing! I'd like to use this with our app in production first before I release the new version of the gem with this feature in it.

@ramontayag

This comment has been minimized.

Copy link
Contributor

ramontayag commented Apr 28, 2014

@adomokos thanks. Let's close this. I'll bring up the compatible actions discussion again in the future.

@ramontayag ramontayag closed this Apr 28, 2014

padi pushed a commit to padi/light-service that referenced this issue Jan 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment