<s> from __future__ import absolute_import <EOL> import sys <EOL> from apscheduler . executors . base import BaseExecutor , run_job <EOL> class AsyncIOExecutor ( BaseExecutor ) : <EOL> """<STR_LIT>""" <EOL> def start ( self , scheduler , alias ) : <EOL> super ( AsyncIOExecutor , self ) . start ( scheduler , alias ) <EOL> self . _eventloop = scheduler . _eventloop <EOL> def _do_submit_job ( self , job , run_times ) : <EOL> def callback ( f ) : <EOL> try : <EOL> events = f . result ( ) <EOL> except : <EOL> self . _run_job_error ( job . id , * sys . exc_info ( ) [ <NUM_LIT:1> : ] ) <EOL> else : <EOL> self . _run_job_success ( job . id , events ) <EOL> f = self . _eventloop . run_in_executor ( None , run_job , job , job . _jobstore_alias , run_times , <EOL> self . _logger . name ) <EOL> f . add_done_callback ( callback ) </s>
