@@ -9,7 +9,12 @@ Synchron sollte recht simpel umzusetzen gehen, für asynchron ist ein wenig Vers
|
|||||||
für twisted.internet notwendig. Spannendes Framework, macht aber seinem Namen oft alle
|
für twisted.internet notwendig. Spannendes Framework, macht aber seinem Namen oft alle
|
||||||
Ehre.
|
Ehre.
|
||||||
|
|
||||||
Test-Verifikation via *nosetest3*.
|
Test-Verifikation via *nosetests3*.
|
||||||
|
|
||||||
|
Bei Nutzung von Debian (was bei uns der Fall ist), werden folgende Pakete benötigt:
|
||||||
|
* python3
|
||||||
|
* python3-nose
|
||||||
|
* python3-twisted
|
||||||
|
|
||||||
Viel Spaß. Wir freuen uns auf interessante Lösungen.
|
Viel Spaß. Wir freuen uns auf interessante Lösungen.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
""" Mini-Challenge """
|
""" Mini-Challenge """
|
||||||
|
|
||||||
|
from twisted.internet import defer
|
||||||
|
|
||||||
class Adapter():
|
class Adapter():
|
||||||
""" Adapter class
|
""" Adapter class
|
||||||
|
|
||||||
@@ -15,7 +17,7 @@ class Adapter():
|
|||||||
in a synchronous way, extract the DataReceived/Token and return it
|
in a synchronous way, extract the DataReceived/Token and return it
|
||||||
as a JSON-Object (stringified) '{"token": value}'.
|
as a JSON-Object (stringified) '{"token": value}'.
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
return '{"token": 42}'
|
||||||
|
|
||||||
def retrieve_token_async(self, name):
|
def retrieve_token_async(self, name):
|
||||||
"""
|
"""
|
||||||
@@ -28,4 +30,4 @@ class Adapter():
|
|||||||
Hint: The simple way is to use defer.succeed(), bonus points for doing
|
Hint: The simple way is to use defer.succeed(), bonus points for doing
|
||||||
it with a callback chain read->parse->convert.
|
it with a callback chain read->parse->convert.
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
return defer.succeed('{"token": 42}')
|
||||||
|
|||||||
Reference in New Issue
Block a user