Deutsch   English   Français   Italiano  
<ugrbks$c65k$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: =?UTF-8?B?U3TDqXBoYW5lIFJpdmnDqHJl?= <stef@genesix.org>
Newsgroups: fr.comp.lang.ada
Subject: Re: Question sur les tasks
Date: Thu, 19 Oct 2023 15:40:44 +0200
Organization: La Maison
Lines: 96
Message-ID: <ugrbks$c65k$1@dont-email.me>
References: <ugmat3$320j2$1@dont-email.me> <ugpb9p$3qmd2$1@dont-email.me>
Reply-To: stef@genesix.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 19 Oct 2023 13:40:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="78066095dede56b20fdd1de4e62237fa";
	logging-data="399540"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18I4Mpn1ym+L4D4hfNDRgkeRFW7Y5x3mBQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:DjZOddLcpRKzTG12x1QYkU5uuHk=
In-Reply-To: <ugpb9p$3qmd2$1@dont-email.me>
Content-Language: fr
Bytes: 3953

Bonjour Pascal,

> La déclaration de SQL_Ping à ce niveau fait qu'elle démarre dès son 
> élaboration.

D'accord... je comprends.

> Et donc sans doute avant l'initialisation de quelques codes utiles à 
> Msg.Std que permet l'ajout du delay.

Ahhhh...

> Ce qui rend le fonctionnement très dépendant de beaucoup de choses :-(

> Du coup, dans ces cas là, j'ajoute toujours un "accept Start" (à la 
> place de ton "delay 0.1;") qui va attendre un appel à "Start" que tu vas 
> pouvoir mettre dans ton code une fois que tout a été initialisé.

> Autres astuces:

Trop bien tes astuces !!! Tout implémenté, ça gaze nickel e!

Grand merci pour ton aide...


----------------------------------------------------------------------------
    function Image is new UXStrings.Conversions.Fixed_Point_Image 
(Duration);

 
----------------------------------------------------------------------------
    task SQL_Ping is
       entry Start;
    end SQL_Ping;

    task body SQL_Ping is
       Delay_Value : Duration := 3600.0;  -- Wait 1 hour between pings
    begin
       accept Start;

       Msg.Std ("TestGui.SQL_Ping > Armed for " & Trim_Left 
(Field_By_Index (Image (Delay_Value), 1, ".")) & "s cycles");

       loop
          delay Delay_Value;
          Msg.Dbg ("TestGui.SQL_Ping > Sent");
          Sql.Ping;
       end loop;
    end SQL_Ping;

-------------------------------------------------------------------------------
begin

    if Ini.App then

       Gnoga.Log 
("------------------------------------------------------------------------"); 
--  To ease gnoga log file reading
       Gnoga.Log ("Starting Gnoga server");
       Msg.Std ("TestGui.On_Connect > Starting Gnoga server");

       Gui.Setup (On_User_Connect => Usr.Connect'Unrestricted_Access,
                  Host => App_Config_Datas.Connection_Domain,
                  Port => App_Config_Datas.Connection_Port,
                  Boot => "boot_jqueryui.html",
                  Title => App_Name_Gui,
                  Server_Closed_Content => "<b>" & App_Name_Gui & " > 
Déconnexion serveur</b>");

       Gui.Set_Application_Icon ("ico-widget.png");
       Gui.Set_User_Icon ("ico-user.png");

       Gui.Set_Login (Off); -- Application access is protected by a 
login screen. Set-it to Off to ease tests and debugging

       --  Application menu hierarchy
       Gui.Header_Set_Root ("App_Menu", App_Name_Gui, 
On_Mgt'Unrestricted_Access);
       Gui.Header_Application_Menu_Add ("Mgt", "Gestion", "App_Menu", 
On_Mgt'Unrestricted_Access);
       Gui.Header_Application_Menu_Add ("Adm", "Administration", 
"App_Menu", On_Adm'Unrestricted_Access);

       -- Start Sql_Ping task
       SQL_Ping.Start;

       --  Application message loop
       Gnoga.Application.Multi_Connect.Message_Loop;

    end if;


-- 
Stéphane Rivière
Ile d'Oléron - France