[sheepdog] [PATCH v7 6/6] sheep: add a cluster driver for shepherd
Liu Yuan
namei.unix at gmail.com
Mon Mar 11 06:27:15 CET 2013
On 03/11/2013 11:48 AM, Hitoshi Mitake wrote:
> +static void read_msg_from_shepherd(void)
> +{
> + switch (state) {
> + case STATE_PRE_JOIN:
> + read_msg_pre_join();
> + break;
> + case STATE_JOINED:
> + read_msg();
For read_msg and read_msg_pre_join, you actually do more than 'read msg'
by actually handling the message.
So I'd suggest a helper read message and pass the rcv message to switch
statements.
By the way, the main proper of read_msg() is very big. How about
translating each case handling into function pointers similar to
zk_event_handlers ?
Thanks,
Yuan
More information about the sheepdog
mailing list