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

set_context on WorkGraph, not on Task? #358

Open
GeigerJ2 opened this issue Nov 21, 2024 · 0 comments
Open

set_context on WorkGraph, not on Task? #358

GeigerJ2 opened this issue Nov 21, 2024 · 0 comments

Comments

@GeigerJ2
Copy link
Contributor

GeigerJ2 commented Nov 21, 2024

add1.set_context({'result': 'sum.add1'})

Move set_context method to WG instead? This would require:

wg.set_context({'add1.result': 'sum.add1'})

as "result" is not uniquely defined anymore in the WG where there might be multiple "result".

However, anyway better to pass objects, rather than strings -> EDIT: Passing objects not possible, as they don't exist yet; strings are just pointers to the future entities.

As noted by @edan-bainglass, making syntax shorter, from:

add1.set_context({'result': 'sum.add1'})
add2.set_context({'result': 'sum.add2'})

to:

wg.set_context({
	"add1": {"sum": "result"},
	"add2": {"sum": "result"}
})

(or similar...)

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