From 490b7298042669ae84494b9ce3c64d6c68526141 Mon Sep 17 00:00:00 2001 From: nocturn9x Date: Wed, 18 Nov 2020 20:48:32 +0100 Subject: [PATCH] Fixed some typos and errors --- README.md | 4 ++-- giambio/util/debug.py | 43 ++++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 2ede0ee..6c844e7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ that most of the following text is ~~stolen~~ inspired from its documentation) # What the hell is async anyway? -Libraries like giambio shine the most when it comes to performing asyncronous I/O (reading a socket, writing to a file, that sort of thing). +Libraries like giambio shine the most when it comes to performing asynchronous I/O (reading from a socket, writing to a file, that sort of thing). The most common example of this is a network server that needs to handle multiple connections at the same time. One possible approach to achieve concurrency is to use threads, and despite their bad reputation in Python, they actually might be a good choice when it comes to I/O for reasons that span far beyond the scope of this tutorial. @@ -515,7 +515,7 @@ of its children task and ask `giambio.run` to wake him up after a given amount o __Note__: You may wonder whether you can mix async libraries: for instance, can we call `trio.sleep` in a giambio application? The answer is no, we can't, and this section explains why. When you call -`await giambio.sleep`, it asks `giambio.run` to pause the current task, and to do to it talks a language +`await giambio.sleep`, it asks `giambio.run` to pause the current task, and to do so it talks a language that only `giambio.run` can understand. Other libraries have other private "languages", so mixing them is not possible: doing so will cause giambio to get very confused and most likely just explode spectacularly badly diff --git a/giambio/util/debug.py b/giambio/util/debug.py index 7f9fb56..7d580da 100644 --- a/giambio/util/debug.py +++ b/giambio/util/debug.py @@ -31,7 +31,7 @@ class BaseDebugger(ABC): This method is called when the event loop starts executing """ - + raise NotImplementedError @abstractmethod @@ -40,7 +40,7 @@ class BaseDebugger(ABC): This method is called when the event loop exits entirely (all tasks completed) """ - + raise NotImplementedError @abstractmethod @@ -51,12 +51,12 @@ class BaseDebugger(ABC): :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task :param delay: The delay, in seconds, after which the task will start executing :type delay: int """ - + raise NotImplementedError @abstractmethod @@ -67,11 +67,11 @@ class BaseDebugger(ABC): :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task """ raise NotImplementedError - + @abstractmethod def on_task_exit(self, task: Task): """ @@ -79,20 +79,20 @@ class BaseDebugger(ABC): :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task """ raise NotImplementedError - + @abstractmethod def before_task_step(self, task: Task): """ This method is called right before - calling its run() method + calling a task's run() method :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task """ raise NotImplementedError @@ -101,11 +101,11 @@ class BaseDebugger(ABC): def after_task_step(self, task: Task): """ This method is called right after - calling its run() method + calling a task's run() method :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task """ raise NotImplementedError @@ -118,23 +118,23 @@ class BaseDebugger(ABC): :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task :param seconds: The amount of seconds the task wants to sleep :type seconds: int """ raise NotImplementedError - + @abstractmethod def after_sleep(self, task: Task, seconds: Union[int, float]): """ - This method is called before after a tasks + This method is called after a tasks awakes from sleeping - + :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task :param seconds: The amount of seconds the task actually slept :type seconds: int @@ -178,7 +178,7 @@ class BaseDebugger(ABC): :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task """ raise NotImplementedError @@ -191,7 +191,8 @@ class BaseDebugger(ABC): :param task: The Task object representing a giambio Task and wrapping a coroutine - :type task: class: giambio.objects.Task + :type task: :class: giambio.objects.Task """ - - raise NotImplementedError \ No newline at end of file + + raise NotImplementedError +