Skip to content

Instantly share code, notes, and snippets.

View ikhoon's full-sized avatar
😀
Working from home

Ikhun Um ikhoon

😀
Working from home
View GitHub Profile
/*
* 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
@ikhoon
ikhoon / ServiceGroupTest.java
Last active July 6, 2023 15:22
Implementation of a service group that allows multiple services to be grouped together and bound to multiple prefixes.
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;
@ikhoon
ikhoon / git-checkout-pr.sh
Last active May 4, 2023 09:30 — forked from trustin/git-checkout-pr.sh
git-checkout-pr.sh - fetches a Git pull request from the remote and creates a local branch for it
#!/usr/bin/env bash
set -Eeuo pipefail
log() {
echo -en '\033[1;32m'
echo -n "$@"
echo -e '\033[0m'
}
choice() {
#!/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
@ikhoon
ikhoon / contributors.sh
Last active November 21, 2023 07:24
Extract Armeria contributors
#!/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
@ikhoon
ikhoon / test.json5
Created December 8, 2021 05:33
test.json5
{
// 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',],

Armeria on Scala

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;
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
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)