openmicroservices.org icon indicating copy to clipboard operation
openmicroservices.org copied to clipboard

Remove console interface

Open wilzbach opened this issue 6 years ago • 3 comments

The console interface is very nice and could reduce the "boilerplate" to 3 lines:

def main(arg1, arg2):
    print(arg1, arg2)


if __name__ == '__main__':
    from sys import argv
    main(*argv[1:])

However, it has three big disadvantages:

  • no auto-serialization (it's just strings)
  • it's still code that a high-level user shouldn't care about
  • starting a process in an interpreted language like Python/NodeJS does come with an overhead

Now, of course the serialization bit could be handled with two more lines:

def main(arg1, arg2):
    print(arg1, arg2)


if __name__ == '__main__':
    from sys import argv
    from json import loads
    main(*map(loads, argv[1:]))

However, the number of characters that can be processed via the CLI has a limit (see e.g. https://serverfault.com/questions/163371/linux-command-line-character-limit, https://www.in-ulm.de/~mascheck/various/argmax/) which is why I think we shouldn't recommend to use the console interface.

wilzbach avatar Apr 08 '19 19:04 wilzbach

@microservices/omg-maintainers I am in favour of dropping the console interface, as it's restrictive, and always has overhead in terms of starting up.

judepereira avatar Aug 13 '19 15:08 judepereira

@microservices/omg-maintainers Please weigh in.

judepereira avatar Aug 13 '19 16:08 judepereira

I'm fine with dropping it, we can always add it back in future if it is a desired feature.

williammartin avatar Sep 09 '19 09:09 williammartin