# coding: utf-8

from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals

from typing import AnyStr, Callable
from infra.nanny.nanny_services_rest.nanny_services_rest.client import ServiceRepoClient
try:
    import queue
except ImportError:
    import Queue as queue

from .service import NannyServiceBase


class NannyServiceIterator(object):

    def __init__(self, category: AnyStr='/', filter_: Callable[[NannyServiceBase], bool]=None):
        self._nanny: ServiceRepoClient = ...
        self._page_size: int = ...
        self._skip: int = ...
        self._buffer: queue.Queue = ...
        self._category = category
        self._filter = filter_
        ...

    def __iter__(self):
        return self

    def __next__(self) -> NannyServiceBase: ...

    def next(self):
        return self.__next__()
