openwhisk-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Santana <csantan...@gmail.com>
Subject Re: Promises (or equivalent) in Python and GoLang
Date Mon, 17 Sep 2018 21:34:40 GMT
I think the javascript community is moving away (and it should :-)) from
using Promises and into using async/await with try/catch and writing more
sync looking code and avoid some of the pitfalls that promises and
callbacks have.

I'm aware that async/await is based on Promises building block, but high
level development chaining logic would not be using them at that high level.

For golang I'm new to the language but so far what the community calls
"idomatic" golang all learning resources (i.e. books, stdlib) use go
routines and channels as a way to get back those results. Like Markus said.

about python, I'm not deep into the language to provide guidance.

-- Carlos

On Mon, Sep 17, 2018 at 5:13 AM Michele Sciabarra <michele@sciabarra.com>
wrote:

> Yes, understood. But some APIs, similar to Javascript API I think, are
> still needed. THere are not yet, as there are not yet for Python as I see
> in the repo (and there is an open issue to provide them).
>
>
> --
>   Michele Sciabarra
>   michele@sciabarra.com
>
> ----- Original message -----
> From: Markus Thömmes <markusthoemmes@apache.org>
> To: dev@openwhisk.apache.org
> Subject: Re: Promises (or equivalent) in Python and GoLang
> Date: Mon, 17 Sep 2018 10:07:15 +0200
>
> Hi Michele,
>
> commenting only on Golang: While there are packages available that provide
> a similar API surface, they have very little adoption throughout the Golang
> community.
>
> In general, the mechanism to achieve concurrent processing in Golang is
> goroutines (https://tour.golang.org/concurrency/1). The mechanism to
> communicate results in an asynchronous way is buffered channels (
> https://tour.golang.org/concurrency/3).
>
> Any specific behavior you're after?
>
> Cheers,
> Markus
>
> Am Mo., 17. Sep. 2018 um 07:43 Uhr schrieb Michele Sciabarra <
> michele@sciabarra.com>:
>
> > Hello,
> >
> > I checked the repositories for Python and GoLang clients, and I was
> > expecting to find some API to perform asynchronous computation, much like
> > Promises in Javascript.  You know, in Javascript you so
> > ow.actions.invoke(...).then(...).
> >
> > What is the equivalent in Python, if any? Is there an equivalent in
> > GoLang?
> >
> > --
> >   Michele Sciabarra
> >   michele@sciabarra.com
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message