@@ -37,27 +37,14 @@ def capture_event(self, event):
3737 """
3838 raise NotImplementedError ()
3939
40- def shutdown (self , timeout , callback = None ):
41- """Initiates a controlled shutdown that should flush out pending
42- events. The callback must be invoked with the number of pending
43- events and the timeout if the shutting down would take some period
44- of time (eg: not instant).
45- """
46- self .kill ()
40+ def flush (self , timeout , callback = None ):
41+ """Wait `timeout` seconds for the current events to be sent out."""
42+ pass
4743
4844 def kill (self ):
4945 """Forcefully kills the transport."""
5046 pass
5147
52- def copy (self ):
53- """Copy the transport.
54-
55- The returned transport should behave completely independent from the
56- previous one. It still may share HTTP connection pools, but not share
57- any state such as internal queues.
58- """
59- return self
60-
6148 def __del__ (self ):
6249 try :
6350 self .kill ()
@@ -161,22 +148,15 @@ def send_event_wrapper():
161148
162149 self ._worker .submit (send_event_wrapper )
163150
164- def shutdown (self , timeout , callback = None ):
165- logger .debug ("Shutting down HTTP transport orderly" )
166- if timeout <= 0 :
167- self ._worker .kill ()
168- else :
169- self ._worker .shutdown (timeout , callback )
151+ def flush (self , timeout , callback = None ):
152+ logger .debug ("Flushing HTTP transport" )
153+ if timeout > 0 :
154+ self ._worker .flush (timeout , callback )
170155
171156 def kill (self ):
172157 logger .debug ("Killing HTTP transport" )
173158 self ._worker .kill ()
174159
175- def copy (self ):
176- transport = type (self )(self .options )
177- transport ._pool = self ._pool
178- return transport
179-
180160
181161class _FunctionTransport (Transport ):
182162 def __init__ (self , func ):
0 commit comments