Fixed some typos and errors

This commit is contained in:
nocturn9x 2020-11-18 20:48:32 +01:00
parent 3661e75eec
commit 490b729804
2 changed files with 24 additions and 23 deletions

View File

@ -21,7 +21,7 @@ that most of the following text is ~~stolen~~ inspired from its documentation)
# What the hell is async anyway? # 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. 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 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. 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 __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 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 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 not possible: doing so will cause giambio to get very confused and most likely just explode spectacularly badly

View File

@ -31,7 +31,7 @@ class BaseDebugger(ABC):
This method is called when the event This method is called when the event
loop starts executing loop starts executing
""" """
raise NotImplementedError raise NotImplementedError
@abstractmethod @abstractmethod
@ -40,7 +40,7 @@ class BaseDebugger(ABC):
This method is called when the event This method is called when the event
loop exits entirely (all tasks completed) loop exits entirely (all tasks completed)
""" """
raise NotImplementedError raise NotImplementedError
@abstractmethod @abstractmethod
@ -51,12 +51,12 @@ class BaseDebugger(ABC):
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine 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 :param delay: The delay, in seconds, after which
the task will start executing the task will start executing
:type delay: int :type delay: int
""" """
raise NotImplementedError raise NotImplementedError
@abstractmethod @abstractmethod
@ -67,11 +67,11 @@ class BaseDebugger(ABC):
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine giambio Task and wrapping a coroutine
:type task: class: giambio.objects.Task :type task: :class: giambio.objects.Task
""" """
raise NotImplementedError raise NotImplementedError
@abstractmethod @abstractmethod
def on_task_exit(self, task: Task): def on_task_exit(self, task: Task):
""" """
@ -79,20 +79,20 @@ class BaseDebugger(ABC):
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine giambio Task and wrapping a coroutine
:type task: class: giambio.objects.Task :type task: :class: giambio.objects.Task
""" """
raise NotImplementedError raise NotImplementedError
@abstractmethod @abstractmethod
def before_task_step(self, task: Task): def before_task_step(self, task: Task):
""" """
This method is called right before This method is called right before
calling its run() method calling a task's run() method
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine giambio Task and wrapping a coroutine
:type task: class: giambio.objects.Task :type task: :class: giambio.objects.Task
""" """
raise NotImplementedError raise NotImplementedError
@ -101,11 +101,11 @@ class BaseDebugger(ABC):
def after_task_step(self, task: Task): def after_task_step(self, task: Task):
""" """
This method is called right after This method is called right after
calling its run() method calling a task's run() method
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine giambio Task and wrapping a coroutine
:type task: class: giambio.objects.Task :type task: :class: giambio.objects.Task
""" """
raise NotImplementedError raise NotImplementedError
@ -118,23 +118,23 @@ class BaseDebugger(ABC):
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine 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 :param seconds: The amount of seconds the
task wants to sleep task wants to sleep
:type seconds: int :type seconds: int
""" """
raise NotImplementedError raise NotImplementedError
@abstractmethod @abstractmethod
def after_sleep(self, task: Task, seconds: Union[int, float]): 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 awakes from sleeping
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine 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 :param seconds: The amount of seconds the
task actually slept task actually slept
:type seconds: int :type seconds: int
@ -178,7 +178,7 @@ class BaseDebugger(ABC):
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine giambio Task and wrapping a coroutine
:type task: class: giambio.objects.Task :type task: :class: giambio.objects.Task
""" """
raise NotImplementedError raise NotImplementedError
@ -191,7 +191,8 @@ class BaseDebugger(ABC):
:param task: The Task object representing a :param task: The Task object representing a
giambio Task and wrapping a coroutine giambio Task and wrapping a coroutine
:type task: class: giambio.objects.Task :type task: :class: giambio.objects.Task
""" """
raise NotImplementedError raise NotImplementedError