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

Support passing promises to activities #29

Open
sjones4 opened this issue Jun 18, 2014 · 0 comments
Open

Support passing promises to activities #29

sjones4 opened this issue Jun 18, 2014 · 0 comments

Comments

@sjones4
Copy link

sjones4 commented Jun 18, 2014

It is not currently possible (out of the box) to pass a promise to an activity from a workflow with glisten. Currently you would use something like:

  interface MyActivities {
    String myActivity( String )
  }

  waitFor( myPromise ) { String promised ->
    activities.myActivity( promised  )
  }

rather than the approach you can use with the flow framework:

  promisedActivities.myActivity( myPromise )

so passing the promise directly. In the above example promisedActivities could be a (caller for an) interface generated based on the regular activities interface but with all parameters wrapped in a promise (as with the methods generated by the flow framework via APT):

  @GlistenTheseActivities
  interface MyPromisedActivities extends MyActivities {
    // Generated method:
    // String myActivity( Promise<String> )
  }

With Groovy, generation of the interface could be done via AST so would not require any special configuration and would be opt-in (via annotation). To invoke there would be a modification/variation of AsyncCaller that did not wrap parameters with promises.

It seems beneficial to allow passing promises from workflows, but I'm not sure if this fits with the motivations for glisten (or if this functionality is not necessary for some reason)

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

1 participant