Unit
타입에 반환하는 함수의 반환값을 확인하지 않으면 컴파일러 워닝이 발생함-Xfatal-warnings
옵션이 활성화 되면 컴파일도 실패됨- http4s-armeria/ArmeriaHttp4sHandler.scala at 39e3ae4847e071a80da3a8250ff6e405e58d55c6 · http4s/http4s-armeria · GitHub
Function<? super HttpService, ? HttpService>
형태의 일 경우에 Scala Function에서 바로 형변환이 되지 않기 때문에delegate => new MyHttpService(delegate)
를 해줘야 함- Decorator를 편하게 쓸수 있게 Scala Function용으로 하나 제공해주면 좋을것 같음
- sttp/AbstractArmeriaBackend.scala at d556bfacf3ed587c6622d6a362aaa1cd81911030 · softwaremill/sttp · GitHub
- [http4s-armeria/ArmeriaClientBuilder.scala at cc1ee774bedfa38387ce3eadfb002b719fbdcb6a · http4s/http4s-armeria · GitHub](https:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2023 LINE Corporation | |
* | |
* LINE Corporation licenses this file to you under the Apache License, | |
* version 2.0 (the "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at: | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.armeria; | |
import static org.assertj.core.api.Assertions.assertThat; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Set; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.extension.RegisterExtension; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
log() { | |
echo -en '\033[1;32m' | |
echo -n "$@" | |
echo -e '\033[0m' | |
} | |
choice() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
BREW='/opt/homebrew/bin/brew' | |
if [[ ! -x "$BREW" ]]; then | |
echo 'Install Homebrew first:' | |
echo | |
echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' | |
echo | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ARMERIA_DIR=??? # Path to Armeria project | |
RELEASE_NOTES_DIR=site/src/pages/release-notes | |
VERSIONS=$@ | |
all="" | |
for version in $VERSIONS; do | |
current=`grep " '" $ARMERIA_DIR/$RELEASE_NOTES_DIR/$version.mdx | sed "s/[',]//g"` | |
all="$all$current" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// comments | |
unquoted: 'and you can quote me on that', | |
singleQuotes: 'I can use "double quotes" here', | |
lineBreaks: "Look, Mom! \ | |
No \\n's!", | |
hexadecimal: 0xdecaf, | |
leadingDecimalPoint: .8675309, andTrailing: 8675309., | |
positiveSign: +1, | |
trailingComma: 'in objects', andIn: ['arrays',], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.armeria; | |
import java.nio.charset.StandardCharsets; | |
import java.time.Duration; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.extension.RegisterExtension; | |
import org.reactivestreams.Publisher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FixedStreamMessageTest { | |
@ArgumentsSource(IntsProvider.class) | |
@ParameterizedTest | |
void spec_306_requestAfterCancel(List<Integer> nums) throws InterruptedException { | |
final Integer[] array = nums.stream().toArray(Integer[]::new); | |
final StreamMessage<Integer> message = StreamMessage.of(array); | |
final CompletableFuture<Subscription> subscriptionFuture = new CompletableFuture<>(); | |
message.subscribe(new Subscriber<Integer>() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.RuntimeException: null | |
at com.linecorp.armeria.internal.client.grpc.ArmeriaClientCall.close(ArmeriaClientCall.java:441) | |
at com.linecorp.armeria.internal.client.grpc.ArmeriaClientCall.transportReportStatus(ArmeriaClientCall.java:398) | |
at com.linecorp.armeria.internal.common.grpc.GrpcStatus.reportStatus(GrpcStatus.java:259) | |
at com.linecorp.armeria.internal.common.grpc.HttpStreamReader.onNext(HttpStreamReader.java:128) | |
at com.linecorp.armeria.internal.common.grpc.HttpStreamReader.onNext(HttpStreamReader.java:44) | |
at com.linecorp.armeria.common.stream.DefaultStreamMessage.notifySubscriberWithElements(DefaultStreamMessage.java:404) | |
at com.linecorp.armeria.common.stream.DefaultStreamMessage.notifySubscriber0(DefaultStreamMessage.java:382) | |
at com.linecorp.armeria.common.stream.DefaultStreamMessage.doRequest(DefaultStreamMessage.java:239) | |
at com.linecorp.armeria.common.stream.DefaultStreamMessage.request(DefaultStreamMessage.java:224) |
NewerOlder