+
    DfjV                         R t ^ RIt^ RIHtHtHtHtHtHt	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHt ]! ]4       ! R R]P&                  ]P(                  4      4       tR	 tRR
.tR# )z
A poll() based implementation of the twisted main loop.

To install the event loop (and you should do this before any connections,
listeners or connectors are added)::

    from twisted.internet import pollreactor
    pollreactor.install()
N)POLLERRPOLLHUPPOLLINPOLLNVALPOLLOUTerrorpoll)implementer)	posixbase)IReactorFDSet)logc                      a  ] tR t^$t o Rt]],          ],          t]	t
]tR tR tR tR tR tR tR tR	 tR
 t]tR tR tRtV tR# )PollReactora  
A reactor that uses poll(2).

@ivar _poller: A L{select.poll} which will be used to check for I/O
    readiness.

@ivar _selectables: A dictionary mapping integer file descriptors to
    instances of L{FileDescriptor} which have been registered with the
    reactor.  All L{FileDescriptor}s which are currently receiving read or
    write readiness notifications will be present as values in this
    dictionary.

@ivar _reads: A dictionary mapping integer file descriptors to arbitrary
    values (this is essentially a set).  Keys in this dictionary will be
    registered with C{_poller} for read readiness notifications which will
    be dispatched to the corresponding L{FileDescriptor} instances in
    C{_selectables}.

@ivar _writes: A dictionary mapping integer file descriptors to arbitrary
    values (this is essentially a set).  Keys in this dictionary will be
    registered with C{_poller} for write readiness notifications which will
    be dispatched to the corresponding L{FileDescriptor} instances in
    C{_selectables}.
c                    \        4       V n        / V n        / V n        / V n        \
        P                  P                  V 4       R# )zW
Initialize polling object, file descriptor tracking dictionaries, and
the base class.
N)r   _poller_selectables_reads_writesr
   PosixReactorBase__init__)selfs   &>/usr/lib/python3/dist-packages/twisted/internet/pollreactor.pyr   PollReactor.__init__C   s7    
 v""++D1    c                ^    V P                   P                  V4       ^ pWP                  9   d   V\        ,          pWP
                  9   d   V\        ,          pV^ 8w  d   V P                   P                  W4       R# WP                  9   d   V P                  V R# R#   \         d     Li ; i)z*Register/unregister an fd with the poller.N)	r   
unregisterKeyErrorr   r   r   r   registerr   )r   fdmasks   && r   _updateRegistrationPollReactor._updateRegistrationN   s    	LL##B' &=D'>D19LL!!"+&&&%%b) '  		s   B B,+B,c                     VP                  4       pW#,           Y29   d   Y# T P	                  T4       R # R #   \         d1    T P                  P                  4        F  w  r4YJ g   K    KR  	   R # i ; iN)filenoBaseExceptionr   itemsr    )r   
selectablemdictr   fdess   &&&  r   _dictRemovePollReactor._dictRemove`   sw    	""$B I ;	$$R(   		 !--335% 6 		s   7 ,A2(A2,A21A2c                    VP                  4       pW P                  9  d1   WP                  V&   ^V P                  V&   V P                  V4       R# R# )z@Add a FileDescriptor for notification of data available to read.N)r$   r   r   r    )r   readerr   s   && r   	addReaderPollReactor.addReaderu   sE    ]]_[[ $*b!DKKO$$R( !r   c                    VP                  4       pW P                  9  d1   WP                  V&   ^V P                  V&   V P                  V4       R# R# )zAAdd a FileDescriptor for notification of data available to write.N)r$   r   r   r    )r   writerr   s   && r   	addWriterPollReactor.addWriter}   sF    ]]_\\!$*b! DLL$$R( "r   c                8    V P                  WP                  4      # )z?Remove a Selectable for notification of data available to read.)r*   r   )r   r-   s   &&r   removeReaderPollReactor.removeReader   s    44r   c                8    V P                  WP                  4      # )z@Remove a Selectable for notification of data available to write.)r*   r   )r   r1   s   &&r   removeWriterPollReactor.removeWriter   s    55r   c                    T P                  V P                   Uu. uF  qP                  V,          NK  	  upV P                   Uu. uF  qP                  V,          NK  	  up4      # u upi u upi )z4
Remove all selectables, and return a list of them.
)
_removeAllr   r   r   r   r   s   & r   	removeAllPollReactor.removeAll   s_     -1[[9[rr""[9-1\\:\rr""\:
 	
9:s   A'A,
c                   Ve   \        VR,          4      p V P                  P                  V4      pT P                  pT F1  w  rV T P                  T,          p\        P                  ! YtYuT4       K3  	  R#   \         d3   pTP                  ^ ,          \
        P                  8X  d    Rp?R# h Rp?ii ; i  \         d     K  i ; i)zPoll the poller for new events.Ni  )intr   r   SelectErrorargserrnoEINTR_doReadOrWriter   r   r   callWithLogger)r   timeoutle_drdwr   eventr'   s   &&      r   doPollPollReactor.doPoll   s    'D.)G	!!'*A ##IB!..r2

 z*%H   	vvayEKK'		   s/   A8 B88B5&B0/B00B58CCc                d    V P                    Uu. uF  qP                  V,          NK  	  up# u upi r#   )r   r   r<   s   & r   
getReadersPollReactor.getReaders   s*    04<"!!"%%<<<   -c                d    V P                    Uu. uF  qP                  V,          NK  	  up# u upi r#   )r   r   r<   s   & r   
getWritersPollReactor.getWriters   s*    04="!!"%%===rQ   )r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   r   _POLL_DISCONNECTEDr   _POLL_INr   	_POLL_OUTr   r    r*   r.   r2   r5   r8   r=   rL   doIterationrO   rS   __static_attributes____classdictcell__)__classdict__s   @r   r   r   $   sj     2 !7*X5HI	2*$)*))56
I, K=> >r   r   c                 6    \        4       p ^ RIHp V! V 4       R# )zInstall the poll() reactor.)installReactorN)r   twisted.internet.mainrb   )prb   s     r   installre      s    A41r   re   )rY   rC   selectr   r   r   r   r   r   rA   r   zope.interfacer	   twisted.internetr
   twisted.internet.interfacesr   twisted.pythonr   r   _PollLikeMixinr   re   __all__ r   r   <module>rn      sq       ' & 5  ]M>),,i.F.F M> M>` )
$r   