Add some search functionality and adjust the await() function params.

This commit is contained in:
Joshua Harlow
2013-05-13 18:43:52 -07:00
parent d3a69a4e20
commit 810827e2a2

View File

@@ -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):