File: bench.py

package info (click to toggle)
pyro5 5.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,124 kB
  • sloc: python: 14,328; makefile: 161; sh: 66; javascript: 62
file content (36 lines) | stat: -rw-r--r-- 772 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from Pyro5.api import expose, oneway


@expose
class bench(object):
    def length(self, string):
        return len(string)

    def timestwo(self, value):
        return value * 2

    def bigreply(self):
        return 'BIG REPLY' * 500

    def bigarg(self, arg):
        return len(arg)

    def manyargs(self, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15):
        return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12 + a13 + a14 + a15

    def noreply(self, arg):
        pass

    def varargs(self, *args):
        return len(args)

    def keywords(self, **args):
        return args

    def echo(self, *args):
        return args

    @oneway
    def oneway(self, *args):
        # oneway doesn't return anything
        pass