Skip to content

Latest commit

 

History

History
47 lines (40 loc) · 1.97 KB

toloka.streaming.cursor.UserSkillCursor.md

File metadata and controls

47 lines (40 loc) · 1.97 KB

UserSkillCursor

toloka.streaming.cursor.UserSkillCursor | Source code

UserSkillCursor(
    self,
    toloka_client: Union[TolokaClient, AsyncTolokaClient],
    event_type: Any,
    user_id: Optional[str] = None,
    skill_id: Optional[str] = None,
    id_lt: Optional[str] = None,
    id_lte: Optional[str] = None,
    id_gt: Optional[str] = None,
    id_gte: Optional[str] = None,
    created_lt: Optional[datetime] = None,
    created_lte: Optional[datetime] = None,
    created_gt: Optional[datetime] = None,
    created_gte: Optional[datetime] = None,
    modified_lt: Optional[datetime] = None,
    modified_lte: Optional[datetime] = None,
    modified_gt: Optional[datetime] = None,
    modified_gte: Optional[datetime] = None,
    time_lag: timedelta = ...
)

Iterator over UserSkillEvent objects of a selected event_type.

Parameters Description

Parameters Type Description
toloka_client Union[TolokaClient, AsyncTolokaClient]

TolokaClient object that is being used to search skills.

event_type Any

Skill event type to search.

request UserSkillSearchRequest

Base request to search skills by.

_time_lag -

Time lag between cursor time field upper bound and real time. Default is 1 minute. This lag is required to keep cursor consistent. Lowering this value will make cursor process events faster, but raises probability of missing some events in case of concurrent operations.

Examples:

Iterate over skills acceptances events.

it = UserSkillCursor(event_type='MODIFIED', toloka_client=toloka_client)
current_events = list(it)
# ... new skills could be set ...
new_events = list(it)  # Contains only new events, occurred since the previous call.