From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EEBA9302E2 for ; Sat, 8 Jun 2019 10:27:59 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jJQUKG4zIZ2R for ; Sat, 8 Jun 2019 10:27:59 -0400 (EDT) Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id ADA152FBDF for ; Sat, 8 Jun 2019 10:27:59 -0400 (EDT) Date: Sat, 8 Jun 2019 17:27:53 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 5/5] swim: expose Lua triggers on member update Message-ID: <20190608142753.GJ31327@atlas> References: <12b8ea76f7c1cd100a80ddcea3c29d20354e073e.1559433539.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12b8ea76f7c1cd100a80ddcea3c29d20354e073e.1559433539.git.v.shpilevoy@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org * Vladislav Shpilevoy [19/06/03 14:33]: > > Events object has methods to help a user to determine what update > has happened. > ```Lua > local function on_update(member, events, ctx) > if events:is_new() then This doesn't look proper English to me, events is plural, is_new() is used for singular case. It is either an event_mask, or an event list/set, but not something in the middle. What about: event_mask:has(...)? > + enum swim_ev_mask { > + SWIM_EV_NEW = 0b00000001, > + SWIM_EV_NEW_STATUS = 0b00000010, > + SWIM_EV_NEW_URI = 0b00000100, > + SWIM_EV_NEW_INCARNATION = 0b00001000, > + SWIM_EV_NEW_PAYLOAD = 0b00010000, > + SWIM_EV_UPDATE = 0b00011110, > + SWIM_EV_DROP = 0b00100000, > + }; Or simply export these objects to Lua and let users play with them. -- Konstantin Osipov, Moscow, Russia