internecineWho uses GitHub copilot at work and is limited by tokens. How many tokens are you allotted
* LtHummus_ joined #java
* rorx joined #java
* OmniRadix6989 joined #java
* julemand101 joined #java
* ChaiTRex joined #java
* woodenAllen joined #java
* woodenAllen joined #java
* ChaiTRex joined #java
* woodenAllen joined #java
* iwtga joined #java
* MikeBux joined #java
* hugdru joined #java
* PocketKiller joined #java
* Afroboy joined #java
* woodenAllen joined #java
* woodenAllen joined #java
* lord4163 joined #java
* handicraftsman joined #java
* five618480339176 joined #java
* hugdru joined #java
* woodenAllen joined #java
* woodenAllen joined #java
* pebble joined #java
* GreenResponse joined #java
* hugdru joined #java
* acidjnk joined #java
* kathadris joined #java
* hwpplayer1 joined #java
* hugdru joined #java
* Chai-T-Rex joined #java
* ChaiTRex joined #java
* soulofset joined #java
* hwpplayer1 joined #java
* enoq joined #java
enoqwhen creating a completablefuture inside a virtual thread, does the future suspend on the VT like any other I/O operation?
enoqor does awaiting the future block the carrier thread that launched the VT
enoqat least to me it looks like I need to provide an executor like this var executor = Executors.newVirtualThreadPerTaskExecutor();
* gas51627 joined #java
nimajeisn't a future just a container to write the result into, without any information how the result will be computed? so what happens should depend on whatever gives you that future, in the worst case it just crates it and never calls .complete(…) on it
enoqmy understanding is that the future forks off a new thread and then .get() blocks the thread it is on
enoqwhat I don't know is if the default thread type is changed when running inside a VT and if .get() inside a VT suspend
enoq+s
nimajethat sounds more like FutureTask, how should the Future know what it should do? And where did you get that idea that it would spawn a thread? Especially as CompletableFuture has "this class has no direct control over the computation" in its docs
nimajeyeah, that is one way to create a CompletableFuture that excactly tells you how the result will be computed, even if I don't understand why that gives you a CompletableFuture instead of just a Future, are there really use cases where you want to submit some work, but have the possibility to complete it yourself some other way?