rask  Check-in [f218789063]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:f218789063ca65faeae591b6d2d7e231163fe6c6
Date: 2017-03-12 18:00:46
User: umgeher
Comment:merge from v/0.1.0
Tags And Properties
  • branch=rask/master inherited from [e712659d71]
  • sym-rask/master inherited from [e712659d71]
Context
2017-03-12
18:13
[f930fed1e5] bye bye (user: umgeher, tags: rask/master)
18:12
[339d56cbd1] merge from rask/master (user: umgeher, tags: trunk)
18:00
[f218789063] merge from v/0.1.0 (user: umgeher, tags: rask/master)
17:59
[0174fd3332] Leaf: version stuff (user: umgeher, tags: rask/v/0.1.0)
2017-03-07
07:15
[80d8ec3f6c] merge from v/0.0.120 (user: umgeher, tags: rask/master)
Changes

Changes to rask/README.md.

1
2
3
4
5
6

7
8
9
10
11
12
13
# Rask

## Changelog

|Version|Description|
|----|----|

|0.0.120|riak sets in dict to map and map to dict parsers|
|0.0.119|pdbpp as default pdb. dict to map and map to dict from parser.riak imported|
|0.0.118|wrong namespace fixed|
|0.0.117|dict to map of riak tools fixed|
|0.0.116|riak schema parser|
|0.0.115|some changes in Future Chain|
|0.0.114|concurrent fn pack, Future Chain!|






>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Rask

## Changelog

|Version|Description|
|----|----|
|0.1.0|rask_raid project is merged to rask project|
|0.0.120|riak sets in dict to map and map to dict parsers|
|0.0.119|pdbpp as default pdb. dict to map and map to dict from parser.riak imported|
|0.0.118|wrong namespace fixed|
|0.0.117|dict to map of riak tools fixed|
|0.0.116|riak schema parser|
|0.0.115|some changes in Future Chain|
|0.0.114|concurrent fn pack, Future Chain!|

Changes to rask/rask/main/__init__.py.

125
126
127
128
129
130
131

132
133
134
135
136























137
138
139
140
141
142
143
        define('http_port',default=8088)
        define('rask',default=self.__options__)
        define('raven_color',default=True)
        define('raven_color_fmt',default='%(log_color)s%(levelname)1.1s %(asctime)s %(name)s%(reset)s %(message)s')
        define('raven_no_color_fmt',default='%(levelname)1.1s %(asctime)s %(name)s %(message)s')
        define('utcode',default=self.utcode)


        parse_command_line()
        
        self.ioengine.loop.add_callback(self.__setup_autoreload)
        return True
























    def settings_load(self,name,f_name,encode='json',future=None):
        try:
            define(
                name,
                default=self.__settings_decoders[encode](self.__settings_file_read(f_name))
            )
        except KeyError:







>





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
        define('http_port',default=8088)
        define('rask',default=self.__options__)
        define('raven_color',default=True)
        define('raven_color_fmt',default='%(log_color)s%(levelname)1.1s %(asctime)s %(name)s%(reset)s %(message)s')
        define('raven_no_color_fmt',default='%(levelname)1.1s %(asctime)s %(name)s %(message)s')
        define('utcode',default=self.utcode)

        self.setup_raid()
        parse_command_line()
        
        self.ioengine.loop.add_callback(self.__setup_autoreload)
        return True

    def setup_raid(self):
        from rask.raid.envelop import Envelop as RaidEnvelop
        from rask.raid.handler import Handler as RaidHandler
        from rask.raid.msg import MSG as RaidMSG
        from rask.raid.recipes.c import Hi,Ping
        
        define('raid',default={
            'code':{
                'ns:invalid':'acff04b473ce47d7ad6115454d887ff6',
                'payload:invalid':'cec3aff19fd2449097a02697b39c162c'
            },
            'envelop':RaidEnvelop(),
            'handler':RaidHandler,
            'msg':RaidMSG,
            'recipes':{
                'c':{
                    'ping':Ping().on_msg,
                    'raid.hi':Hi().on_msg
                }
            }
        })
        return True
    
    def settings_load(self,name,f_name,encode='json',future=None):
        try:
            define(
                name,
                default=self.__settings_decoders[encode](self.__settings_file_read(f_name))
            )
        except KeyError:

Added rask/rask/raid/__init__.py.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
from client import Client
from raid import Raid

__all__ = [
    'Client',
    'Raid'
]

Added rask/rask/raid/client.py.

































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from rask.base import Base
from rask.options import options
from rask.parser.date import datetime_float_str
from tornado.websocket import websocket_connect

__all__ = ['Client']

class Client(Base):
    def __init__(self,url):
        self.__connection = websocket_connect(
            url,
            connect_timeout=10.0,
            on_message_callback=self.__on_message__
        )

    @property
    def connection(self):
        try:
            assert self.__connection.result()
        except AssertionError:
            return self.__connection
        except:
            raise
        return self.__connection.result()
        
    def __on_message__(self,body):
        try:
            assert body
        except AssertionError:
            self.ioengine.loop.add_callback(
                self.on_close
            )
            return False
        except:
            raise
        
        def on_decode(_):
            return self.ioengine.loop.add_callback(
                self.__on_message_recipes__,
                msg=_.result()
            )
        
        return options.raid['envelop'].unpack(
            body,
            future=self.ioengine.future(on_decode)
        )

    def __on_message_recipes__(self,msg):
        try:
            assert msg.action in options.raid['recipes']['c']
        except (AssertionError,KeyError):
            self.ioengine.loop.add_callback(
                self.on_msg,
                msg=msg
            )
            return False
        except:
            raise
        return self.ioengine.loop.add_callback(
            options.raid['recipes']['c'][msg.action],
            io=self,
            msg=msg
        )            

    def on_close(self):
        pass
    
    def on_msg(self,msg):
        pass

    def push(self,_):
        def on_encode(payload):
            self.connection.write_message(payload.result())
            return True

        _.payload['header']['__sysdate__'] = datetime_float_str()        
        return options.raid['envelop'].pack(
            _,
            self.ioengine.future(on_encode)
        )

Added rask/rask/raid/envelop.py.



























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
37
38
39
40
41
42
43
44
45
from rask.base import Base
from rask.options import options

__all__ = ['Envelop']

class Envelop(Base):
    @property
    def msg(self):
        return options.raid['msg']
    
    @property
    def utcode(self):
        return options.utcode

    def pack(self,msg,future):
        try:
            assert msg.valid
        except AssertionError:
            future.set_result(False)
            return False
        except:
            raise

        def on_encode(_):
            future.set_result(_.result())
            return True
        
        return self.utcode.encode(
            msg.payload,
            future=self.ioengine.future(on_encode)
        )
    
    def unpack(self,msg,future):
        def on_decode(_):
            future.set_result(
                self.msg(
                    payload=_.result()
                )
            )
            return True
        
        return self.utcode.decode(
            msg,
            future=self.ioengine.future(on_decode)
        )

Added rask/rask/raid/handler.py.



























































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
from rask.http import WSHandler
from rask.parser.date import datetime_float_str
from rask.options import options

__all__ = ['Handler']

class Handler(WSHandler):
    @property
    def actions(self):
        try:
            assert self.__actions
        except (AssertionError,AttributeError):
            self.__actions = {
                'ping':self.__ping__
            }
            self.__actions.update(ACTIONS)
        except:
            raise
        return self.__actions
    
    @property
    def options(self):
        try:
            assert self.__options
        except (AssertionError,AttributeError):
            self.__options = {
                'code':{
                    'ws':{
                        'ns':{
                            'invalid':'acff04b473ce47d7ad6115454d887ff6'
                        },
                        'payload':{
                            'invalid':'cec3aff19fd2449097a02697b39c162c'
                        }
                    }
                }
            }
        except:
            raise
        return self.__options

    def __on_message__(self,msg):
        def on_decode(_):
            try:
                assert _.result().valid
                assert _.result().action in options.raid['recipes']
            except (AssertionError,AttributeError):
                self.error(
                    self.options['code']['ws']['payload']['invalid']
                )
            except:
                raise
            else:
                options.raid['recipes'][_.result().action](
                    io=self,
                    msg=_.result()
                )
            return True

        options.raid['envelop'].unpack(
            msg=msg,
            future=self.ioengine.future(on_decode)
        )
        return True
    
    def __on_message_hi__(self,msg):
        options.raid['recipes']['s']['raid.welcome'](
            io=self,
            msg=msg
        )
        return True

    def __raid_online__(self):
        self.on_message = self.__on_message__
        return True
    
    def call(self,msg):
        try:
            assert msg['header']['action'] in self.actions
        except (AssertionError,KeyError):
            self.error(
                self.options['code']['ws']['ns']['invalid'],
                msg.get('header',{}).get('etag',None)
            )
        except:
            raise
        else:
            self.ioengine.loop.add_callback(
                self.actions[msg['header']['action']],
                msg=msg,
                io=self
            )
        return True

    def error(self,code,etag=None):
        self.push(
            options.raid['msg'](
                {
                    "header":{
                        "action":"error",
                        "code":str(code),
                        "etag":str(etag)
                    }
                }
            )
        )
        return True
    
    def on_message(self,msg):
        pass
    
    def open(self):
        self.log.info(
            '<raid> connected: %s [%s]' % (
                self.request.remote_ip,
                self.uuid
            )
        )
        self.set_nodelay(True)
        self.on_message = self.__on_message_hi__
        options.raid['recipes']['s']['raid.hi'](self)
        return self.ioengine.loop.add_callback(self.on_open)

    def on_close(self):
        pass
        
    def on_open(self):
        pass
    
    def push(self,_):
        def on_encode(payload):
            self.write_message(payload.result())
            return True

        _.payload['header']['__sysdate__'] = datetime_float_str()
        return options.raid['envelop'].pack(
            _,
            self.ioengine.future(on_encode)
        )

    def welcome_check(self,msg):
        try:
            assert self.__welcome_flag__
        except (AssertionError,AttributeError):
            self.ioengine.loop.add_callback(
                self.actions['raid.welcome'],
                msg=msg,
                io=self
            )
        except:
            raise
        else:
            self.ioengine.loop.add_callback(
                self.call,
                msg=msg
            )
        return True

Added rask/rask/raid/msg.py.







































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
from rask.parser.date import datetime_float_str
from rask.base import Base

__all__ = ['MSG']

class MSG(Base):
    def __init__(self,payload):
        self.payload = payload

    @property
    def action(self):
        try:
            assert self.payload['header']['action']
        except (AssertionError,AttributeError,KeyError):
            return None
        except:
            raise
        return self.payload['header']['action']

    @action.setter
    def action(self,_):
        try:
            self.payload['header']['action'] = str(_)
        except:
            raise
        
    @property
    def body(self):
        try:
            assert self.payload['body']
        except (AssertionError,AttributeError,KeyError):
            self.payload['body'] = {}
        except:
            raise
        return self.payload['body']

    @body.setter
    def body(self,_):
        try:
            assert isinstance(_,dict)
        except:
            raise
        else:
            self.payload['body'] = _
        
    @property
    def code(self):
        try:
            assert self.payload['header']['code']
        except (AssertionError,AttributeError,KeyError):
            return None
        except:
            raise
        return self.payload['header']['code']

    @code.setter
    def code(self,_):
        try:
            self.payload['header']['code'] = str(_)
        except:
            raise

    @property
    def etag(self):
        try:
            assert self.payload['header']['etag']
        except (AssertionError,AttributeError,KeyError):
            self.payload['header']['etag'] = self.uuid
        except:
            raise
        return self.payload['header']['etag']

    @etag.setter
    def etag(self,_):
        try:
            self.payload['header']['etag'] = str(_)
        except KeyError:
            self.payload['header'] = {'etag':str(_)}
        except:
            raise
        
    @property
    def payload(self):
        try:
            assert self.__payload
        except AttributeError:
            self.__payload = {
                'body':{},
                'header':{
                    'code':None,
                    'etag':None
                }
            }
        except:
            raise
        return self.__payload

    @payload.setter
    def payload(self,_):
        try:
            assert isinstance(_,dict)
        except:
            raise
        else:
            self.__payload = _

    @property
    def sysdate(self):
        try:
            assert self.__payload['header']['__sysdate__']
        except (AttributeError,KeyError):
            self.__payload['header']['__sysdate__'] = datetime_float_str()
        except:
            raise
        return self.__payload['header']['__sysdate__']

    @sysdate.setter
    def sysdate(self,_):
        self.__payload['header']['__sysdate__'] = _
            
    @property
    def valid(self):
        try:
            assert self.action
            assert self.etag
            assert self.sysdate
        except AssertionError:
            return False
        except:
            raise
        return True

Added rask/rask/raid/raid.py.











































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
from rask.base import Base
from rask.options import options
from recipes.s import Hi,Ping,Welcome

__all__ = ['Raid']

class Raid(Base):
    def __init__(self):
        self.ioengine.loop.add_callback(self.__setup__)

    @property
    def bucket(self):
        try:
            assert self.__bucket
        except (AssertionError,AttributeError):
            self.__bucket = {}
        except:
            raise
        return self.__bucket
    
    @property
    def connections(self):
        try:
            assert self.__connections
        except (AssertionError,AttributeError):
            self.__connections = []
        except:
            raise
        return self.__connections

    @property
    def envelop(self):
        return options.raid['envelop']

    @property
    def handler(self):
        return options.raid['handler']
    
    @property
    def msg(self):
        return options.raid['msg']
    
    def __setup__(self):
        options.raid['bus'] = self
        options.raid['recipes']['s'] = {
            'ping':Ping().on_msg,
            'raid.hi':Hi().on_msg,
            'raid.welcome':Welcome().on_msg
        }
        return True
    
    def bucket_add(self,b,k,v):
        try:
            self.bucket[b][k] = v
        except KeyError:
            self.bucket[b] = {k:v}
        except:
            raise
        return True

    def bucket_broadcast(self,b,payload,i=None):
        try:
            self.bucket[b][i.next()].push(payload)
        except AttributeError:
            self.ioengine.loop.add_callback(
                self.bucket_broadcast,
                b=b,
                payload=payload,
                i=iter(self.bucket.get(b,[]))
            )
        except KeyError:
            self.ioengine.loop.add_callback(
                self.bucket_broadcast,
                b=b,
                payload=payload,
                i=i
            )
        except StopIteration:
            return True
        except:
            raise
        else:
            self.ioengine.loop.add_callback(
                self.bucket_broadcast,
                b=b,
                payload=payload,
                i=i
            )
        return None
    
    def bucket_del(self,b,k):
        try:
            del self.bucket[b][k]
            assert self.bucket[b]
        except AssertionError:
            del self.bucket
        except KeyError:
            pass
        except:
            raise
        return True
    
    def connections_add(self,_):
        self.connections.append(_)
        return True

    def connections_broadcast(self,payload,i=None):
        try:
            i.next().push(payload)
        except AttributeError:
            self.ioengine.loop.add_callback(
                self.connections_broadcast,
                payload=payload,
                i=iter(self.connections)
            )
        except StopIteration:
            return True
        except:
            raise
        else:
            self.ioengine.loop.add_callback(
                self.connections_broadcast,
                payload=payload,
                i=i
            )
        return None
    
    def connections_del(self,_):
        self.connections.remove(_)
        return True

    def recipes_update(self,_):
        return True

Added rask/rask/raid/recipes/__init__.py.

Added rask/rask/raid/recipes/c/__init__.py.





>
>
1
2
from ping import Ping
from raid_hi import Hi

Added rask/rask/raid/recipes/c/ping.py.









































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from rask.base import Base
from rask.options import options
from rask.parser.date import datetime_float_str

__all__ = ['Ping']

class Ping(Base):
    def on_msg(self,io,*args,**kwargs):
        return io.push(
            options.raid['msg'](
                {
                    'body':{
                        '_':datetime_float_str()
                    },
                    'header':{
                        'action':'pong'
                    }
                }
            )
        )

Added rask/rask/raid/recipes/c/raid_hi.py.







































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from rask.base import Base
from rask.options import options

__all__ = ['Hi']

class Hi(Base):
    @property
    def msg(self):
        return options.raid['msg']({
            'body':{
                '_':'raid'
            },
            'header':{
                'action':'raid.welcome'
            }
        })
    
    def on_msg(self,io,*args,**kwargs):
        return io.push(self.msg)

Added rask/rask/raid/recipes/s/__init__.py.







>
>
>
1
2
3
from ping import Ping
from raid_hi import Hi
from raid_welcome import Welcome

Added rask/rask/raid/recipes/s/ping.py.







































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from rask.base import Base
from rask.options import options

__all__ = ['Ping']

class Ping(Base):
    def on_msg(self,io,*args,**kwargs):
        return io.push(
            options.raid['msg'](
                {
                    'body':{
                        '_':True
                    },
                    'header':{
                        'action':'ping'
                    }
                }
            )
        )

Added rask/rask/raid/recipes/s/raid_hi.py.













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from rask.base import Base
from rask.options import options

__all__ = ['Hi']

class Hi(Base):
    def __init__(self):
        self.__msg = options.raid['msg']({
            'body':{
                '_':'raid'
            },
            'header':{
                'action':'raid.hi'
            }
        })

    @property
    def msg(self):
        return self.__msg
    
    def on_msg(self,io,*args,**kwargs):
        return io.push(self.msg)

Added rask/rask/raid/recipes/s/raid_welcome.py.









































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from rask.base import Base
from rask.options import options

__all__ = ['Welcome']

class Welcome(Base):
    def check_pattern(self,io,msg):
        try:
            assert msg.valid
            assert msg.payload['body']['_'] == 'raid'
            assert msg.payload['header']['action'] == 'raid.welcome'
        except (AssertionError,KeyError):
            io.close()
        except:
            raise
        else:
            io.__raid_online__()
            self.ioengine.loop.add_callback(
                self.talk_back,
                io=io,
                etag=msg.etag
            )
        return True

    def on_msg(self,io,*args,**kwargs):
        def on_decode(_):
            self.ioengine.loop.add_callback(
                self.check_pattern,
                io=io,
                msg=_.result()
            )
            return True
        
        return options.raid['envelop'].unpack(
            kwargs.get('msg',''),
            future=self.ioengine.future(on_decode)
        )

    def talk_back(self,io,etag):
        return io.push(
            options.raid['msg'](
                {
                    'body':{
                        '_':'raid'
                    },
                    'header':{
                        'action':'raid.ok',
                        'etag':etag
                    }
                }
            )
        )

Changes to rask/setup.py.

13
14
15
16
17
18
19
20
21
    ],
    license='http://code.umgeher.org/fossil.cgi/rask/artifact/3b9a146264aed1f5',
    maintainer='Umgeher Torgersen',
    maintainer_email='me@umgeher.org',
    name='rask',
    packages=find_packages(),
    url='http://code.umgeher.org/rask',
    version="0.0.120"
)







|

13
14
15
16
17
18
19
20
21
    ],
    license='http://code.umgeher.org/fossil.cgi/rask/artifact/3b9a146264aed1f5',
    maintainer='Umgeher Torgersen',
    maintainer_email='me@umgeher.org',
    name='rask',
    packages=find_packages(),
    url='http://code.umgeher.org/rask',
    version="0.1.0"
)