Пример #1
0
static void
arr_exec(strm_task* task, strm_value data)
{
  struct array_data *arrd = task->data;
  strm_emit(task, arrd->arr->ptr[arrd->n++], NULL);
  if (arrd->n == arrd->arr->len)
    strm_task_close(task);
}
Пример #2
0
static int
arr_exec(strm_task* task, strm_value data)
{
  struct array_data *arrd = task->data;

  if (arrd->n == strm_ary_len(arrd->arr)) {
    strm_task_close(task);
    return STRM_OK;
  }
  strm_emit(task, strm_ary_ptr(arrd->arr)[arrd->n++], arr_exec);
  return STRM_OK;
}
Пример #3
0
static int
arr_exec(strm_task* task, strm_value data)
{
  struct array_data *arrd = task->data;

  if (arrd->n == arrd->arr->len) {
    strm_task_close(task);
    return STRM_OK;
  }
  strm_emit(task, arrd->arr->ptr[arrd->n++], arr_exec);
  return STRM_OK;
}
Пример #4
0
static int
seq_seed(strm_task* task, strm_value data)
{
  struct seq_seeder *s = task->data;

  if (s->n > s->end) {
    strm_task_close(task);
    return STRM_OK;
  }
  strm_emit(task, strm_int_value(s->n), seq_seed);
  s->n += s->inc;
  return STRM_OK;
}