ext/iodine/fio.c
/** Publishes the message to the current process and frees the strings. */
Publishes the message to the current process and frees the strings.
Publishes the message to the current process and frees the strings .
static void fio_publish2process(fio_msg_internal_s *m) {
  fio_msg_internal_finalize(m);
  channel_s *ch;
  if (m->filter) {
    ch = fio_filter_find_dup(m->filter);
    if (!ch) {
      goto finish;
    }
  } else {
    ch = fio_channel_find_dup(m->channel);
  }
  if (ch) {
    fio_defer_push_urgent(fio_publish2channel_task, ch,
                          fio_msg_internal_dup(m));
  }
  if (m->filter == 0) {
    fio_lock(&fio_postoffice.patterns.lock);
    FIO_SET_FOR_LOOP(&fio_postoffice.patterns.channels, p) {
      if (!p->hash) {
        continue;
      }
      if (p->obj->match(
              (fio_str_info_s){.data = p->obj->name, .len = p->obj->name_len},
              m->channel)) {
        fio_channel_dup(p->obj);
        fio_defer_push_urgent(fio_publish2channel_task, p->obj,
                              fio_msg_internal_dup(m));
      }
    }
    fio_unlock(&fio_postoffice.patterns.lock);
  }
finish:
  fio_msg_internal_free(m);
}
static void fio_publish2process ( fio_msg_internal_s * m ) { fio_msg_internal_finalize ( m ) ; channel_s * ch ; if ( m -> filter ) { ch = fio_filter_find_dup ( m -> filter ) ; if ( ! ch ) { goto finish ; } } else { ch = fio_channel_find_dup ( m -> channel ) ; } if ( ch ) { fio_defer_push_urgent ( fio_publish2channel_task , ch , fio_msg_internal_dup ( m ) ) ; } if ( m -> filter == 0 ) { fio_lock ( & fio_postoffice . patterns . lock ) ; FIO_SET_FOR_LOOP ( & fio_postoffice . patterns . channels , p ) { if ( ! p -> hash ) { continue ; } if ( p -> obj -> match ( ( fio_str_info_s ) { . data = p -> obj -> name , . len = p -> obj -> name_len } , m -> channel ) ) { fio_channel_dup ( p -> obj ) ; fio_defer_push_urgent ( fio_publish2channel_task , p -> obj , fio_msg_internal_dup ( m ) ) ; } } fio_unlock ( & fio_postoffice . patterns . lock ) ; } finish : fio_msg_internal_free ( m ) ; }
Publishes the message to the current process and frees the strings.
Publishes the message to the current process and frees the strings .
/* exact match */ /* pattern matching match */