Add some search functionality and adjust the await() function params.
This commit is contained in:
@@ -48,6 +48,18 @@ class JobBoard(object):
|
||||
for i in self._listeners:
|
||||
i.notify_erased(job)
|
||||
|
||||
@abc.abstractmethod
|
||||
def posted_after(self, date_posted=None):
|
||||
"""Gets the jobs posted after (or equal to) the given datetime object
|
||||
(or all jobs if none)."""
|
||||
raise NotImplementedError()
|
||||
|
||||
@abc.abstractmethod
|
||||
def posted_before(self, date_posted=None):
|
||||
"""Gets the jobs posted before the given datetime object
|
||||
(or all jobs if none)."""
|
||||
raise NotImplementedError()
|
||||
|
||||
@abc.abstractmethod
|
||||
def erase(self, job):
|
||||
"""Erases the given job from this job board."""
|
||||
@@ -55,9 +67,8 @@ class JobBoard(object):
|
||||
i._notify_erased(job)
|
||||
|
||||
@abc.abstractmethod
|
||||
def await(self, block=True, timeout=None):
|
||||
"""Blocks the current [thread, greenthread, process] until a new job
|
||||
has arrived."""
|
||||
def await(self, timeout=None):
|
||||
"""Blocks the current thread until a new job has arrived."""
|
||||
raise NotImplementedError()
|
||||
|
||||
def subscribe(self, listener):
|
||||
|
||||
Reference in New Issue
Block a user