removed asyncio from bot_start example
This commit is contained in:
parent
7f035a9d53
commit
a35dc843ea
@ -34,17 +34,12 @@ class AwesomeStrategy(IStrategy):
|
|||||||
|
|
||||||
# ... populate_* methods
|
# ... populate_* methods
|
||||||
|
|
||||||
async def some_asynchronous_task(self):
|
|
||||||
self.dp['remote_data'] = requests.get('https://some_remote_source.example.com')
|
|
||||||
|
|
||||||
def bot_start(self, **kwargs) -> None:
|
def bot_start(self, **kwargs) -> None:
|
||||||
"""
|
"""
|
||||||
Called only once after bot instantiation.
|
Called only once after bot instantiation.
|
||||||
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
||||||
"""
|
"""
|
||||||
self.loop = asyncio.new_event_loop()
|
self.dp['remote_data'] = requests.get('https://some_remote_source.example.com')
|
||||||
asyncio.set_event_loop(self.loop)
|
|
||||||
self.loop.run_until_complete(self.some_asynchronous_task())
|
|
||||||
|
|
||||||
```
|
```
|
||||||
## Bot loop start
|
## Bot loop start
|
||||||
|
Loading…
Reference in New Issue
Block a user