Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Georgy Kirichenko <georgy@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 2/2] On ctl event trigger
Date: Thu, 30 Aug 2018 15:50:23 +0300	[thread overview]
Message-ID: <20180830125023.GC30997@chai> (raw)
In-Reply-To: <7d9ccb894ef2915181454db39ead93497f9ff9aa.1535472838.git.georgy@tarantool.org>

* Georgy Kirichenko <georgy@tarantool.org> [18/08/28 19:20]:
> +		struct on_ctl_event event;
> +		event.type = CTL_SPACE;
> +		event.space.action = CTL_SPACE_CREATE;
> +		event.space.space_id = old_id;
> +		trigger_run(&on_ctl_trigger, &event);

event.type and event.action confuses me. Why do we need both? I
assume because you associate a context to a type, and events of
the same "event type" have the same context. But it seems the
context is defined fully by trigger invocation context, no? 

Please keep in mind that we have been solving the same problem
with audit events. Looks like we need to pull and open source some
of the infrastructure code, such as struct event declaration, so
that we can reuse it for all kinds of events, huh...

>  	if (is_box_configured) {
> +		struct on_ctl_event ctl_event;
> +		ctl_event.type = CTL_SHUTDOWN;
> +		trigger_run(&on_ctl_trigger, &ctl_event);

I don't understand why we call it 'ctl event'. Why not call it
'shutdown_trigger_ctx'? 

Simply put, we begin invoking more triggers, at more places. The
context of the trigger is defined, well, but the context of the
place it is invoked from, not by event type.

ctl_event.h/c seem to be missing?

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

      parent reply	other threads:[~2018-08-30 12:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 16:19 [tarantool-patches] [PATCH 0/2] Box control " Georgy Kirichenko
2018-08-28 16:19 ` [tarantool-patches] [PATCH 1/2] Update lua space cache just after creation Georgy Kirichenko
2018-08-30 12:06   ` Vladimir Davydov
2018-08-31  4:57     ` [tarantool-patches] " Georgy Kirichenko
2018-08-30 12:31   ` Konstantin Osipov
2018-08-31  4:53     ` Georgy Kirichenko
2018-08-28 16:19 ` [tarantool-patches] [PATCH 2/2] On ctl event trigger Georgy Kirichenko
2018-08-30 12:07   ` Vladimir Davydov
2018-08-30 12:10   ` Vladimir Davydov
2018-08-30 12:38   ` Vladimir Davydov
2018-08-30 13:04     ` Georgy Kirichenko
2018-08-30 13:21     ` Vladimir Davydov
2018-08-30 14:45       ` [tarantool-patches] " Konstantin Osipov
2018-08-30 14:40     ` Konstantin Osipov
2018-08-30 12:50   ` Konstantin Osipov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180830125023.GC30997@chai \
    --to=kostja@tarantool.org \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 2/2] On ctl event trigger' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox