Skip to content

FFmpegJob running. how to do force stop job? #298

@13330863440

Description

@13330863440
public  static Set<String> closeIdSet = new HashSet<>();
executor.execute(() -> {
    // thread
     Thread currentThread = Thread.currentThread();
    String currentJobId="xxxx";
   ScheduledExecutorService sche= new ScheduledThreadPoolExecutor(1);
                    sche.scheduleAtFixedRate(() -> {
                       if(closeIdSet.contains(currentJobId)){
                          //force stop thread and stop job  !!  . how to do force stop job?
                           currentThread.stop();
                       }
                    }, 0, 1, TimeUnit.SECONDS);
    
    
    FFmpegJob job = executor.createJob(builder)
    job.run();  // job running.  need force stop running
    
    next steps
    xxxx
    xxxx
    xxxx
});
//add closeIdSet  "xxxx" in  other thread 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions