Skip to content

Commit

Permalink
Try for multiple thread
Browse files Browse the repository at this point in the history
  • Loading branch information
zihanltesla committed May 17, 2024
1 parent 948047b commit bb77a8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/ch/uzh/ifi/hase/soprafs24/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@RestController
@SpringBootApplication
@EnableAsync
public class Application {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import ch.uzh.ifi.hase.soprafs24.repository.GameRepository;
import ch.uzh.ifi.hase.soprafs24.repository.PlayerRepository;
import org.springframework.http.HttpStatus;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.server.ResponseStatusException;
Expand Down Expand Up @@ -121,6 +122,7 @@ public void checkIfAllReady(Room room) {
}
}

@Async
public void startGame(Room room) {
// Initialize a new game object and player objects, then save them to the
// database
Expand Down

0 comments on commit bb77a8a

Please sign in to comment.