/**
 * @flow strict
 */

"use strict";

type RecipientUserIds<UserId: number> = $ReadOnlyArray<UserId>;

type Worker<UserId> = {|
    get_current_time: () => number, // as ms since epoch
    notify_server_start: (RecipientUserIds<UserId>) => void,
    notify_server_stop: (RecipientUserIds<UserId>) => void,
|};

declare export function update<UserId>(
    worker: Worker<UserId>,
    new_recipient: RecipientUserIds<UserId> | null,
): void;
