mesg-foundation / js-sdk

Javascript mono-repo with all the tools to interact with MESG
https://mesg.com
4 stars 4 forks source link

ListenTask cannot be called twice #43

Closed antho1404 closed 4 years ago

antho1404 commented 5 years ago

For now we cannot create our service calling listenTask multiple times and if we do we don't have any clear error message.

Solutions:

ilgooz commented 5 years ago

I think we should still only support calling it once and throw an error in case of multiple calls. Because I cannot see any advantage of supporting multiple calls to listenTask since a service should implement all the defined tasks and start accepting execution request for them all the time.

But we're already throwing an error in case of multiple calls. @antho1404 Is this issue about mentioning this behaviour in the docs page?

antho1404 commented 5 years ago

Yes we could improve the documentation and maybe having a better error in the code, it's quite confusing right now but maybe this PR https://github.com/mesg-foundation/mesg-js/pull/82 will solve that confusion

NicolasMahe commented 5 years ago

fixed