[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference csc32::consolemanager

Title:POLYCENTER Console Manager
Notice:Kits, Scans, Docs on CSC32:: as PCM$KITS:,PCM$DOCS:, PCM$SCANS:
Moderator:CSC32::BUTTERWORTH
Created:Thu Aug 06 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1541
Total number of notes:6564

1190.0. "question on implementing an Action-rtn" by 51336::BERGGREN (Nils Berggren,DC Sweden 876-8287) Wed Feb 07 1996 12:35

     Hi all,

     I've written an action-routine and wonder how X is involved,
     since we have to link it with X-libraries).
     
     If I remember correct, the recomendations, when using X, is not
     to use AST:s.  Is this correct? If it is, can I use the
     'work-procedure'-mechanism in X within an action-routine?
     
     What I want to do in the action-routine is the following:
	1. when an event is received there's some setup done.
	2. The event is processed
	3. a link to the DECmcc system is established
	4. The processed event is sent to DECMcc
	5. disconnect the link.
	
     The ting is that steps 3-5 are quite slow, and when a burst of
     events are comming I don't want to do steps 3 and 5 over and over
     again, rather I'd like to keep sending the events as they come
     and when there are no more events to send (i.e.  no events within
     a specified time-frame) the link is disconnected.
     
     I've been thinking on using threads, or a work-procedure or an
     AST-routine triggered by a timer....
     
     Can this be done?  How should I proceed?  WHich route to take?  

     Thanks for any comments
     
     /Nils
     
     
     
T.RTitleUserPersonal
Name
DateLines
1190.1CSC32::BUTTERWORTHGun Control is a steady hand.Wed Feb 07 1996 15:5956
>     Hi all,

>     I've written an action-routine and wonder how X is involved,
>     since we have to link it with X-libraries).
     
>     If I remember correct, the recomendations, when using X, is not
>     to use AST:s.  Is this correct? If it is, can I use the
>     'work-procedure'-mechanism in X within an action-routine?
    
    This is news to me. The EVentlist action routine ( an X-application as
    you probably know) utilizes the PCM API which relies heavily on AST's
    to communicate with the ENS Daemon.
     
>     What I want to do in the action-routine is the following:
>	1. when an event is received there's some setup done.
>	2. The event is processed
>	3. a link to the DECmcc system is established
>	4. The processed event is sent to DECMcc
>	5. disconnect the link.
	
 >    The ting is that steps 3-5 are quite slow, and when a burst of
 >   events are comming I don't want to do steps 3 and 5 over and over
 >  again, rather I'd like to keep sending the events as they come
 >    and when there are no more events to send (i.e.  no events within
 >    a specified time-frame) the link is disconnected.
     
 >    I've been thinking on using threads, or a work-procedure or an
 >    AST-routine triggered by a timer....
     
 >    Can this be done?  How should I proceed?  WHich route to take?  

 >    Thanks for any comments
     
 >    /Nils
    
    Nils,
      Why can't you just leave the link up? If you have to disconnect the
    link I see no reason why you can't use a timer routine. Your event
    received callback will have to do two things:
    
    1. Cancel an outstanding timer.
    
    2. if there was no timer, then the link is probably gone so reestablish
       the link
    
    3. Send the event to MCC
    
    4. Restart the timer
    
    Regs,
      Dan
    
    2. send the event