This file contains hidden or 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
import java.util.concurrent.atomic.AtomicReference; | |
import java.util.concurrent.atomic.LongAccumulator; | |
public class LongAccumulatorCounter extends ServerCounter { | |
private final AtomicReference<LongAccumulator> accumulator = new AtomicReference<>( | |
new LongAccumulator( | |
(left, right) -> left + right, | |
0L | |
) |
This file contains hidden or 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 org.eclipse.milo.opcua.stack; | |
import java.security.SecureRandom; | |
import java.util.Arrays; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.GCMParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.eclipse.milo.opcua.stack.core.util.CryptoRestrictions; | |
import org.testng.annotations.Test; |
This file contains hidden or 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 org.eclipse.milo.opcua.stack; | |
import java.security.SecureRandom; | |
import java.util.Arrays; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.GCMParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.eclipse.milo.opcua.stack.core.util.CryptoRestrictions; | |
import org.testng.annotations.Test; |
This file contains hidden or 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
public class BrowseExample implements ClientExample { | |
public static void main(String[] args) throws Exception { | |
BrowseExample example = new BrowseExample(); | |
new ClientExampleRunner(example).run(); | |
} | |
private final Logger logger = LoggerFactory.getLogger(getClass()); |
This file contains hidden or 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 org.eclipse.milo.examples.client; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.eclipse.milo.opcua.sdk.client.OpcUaClient; | |
import org.eclipse.milo.opcua.sdk.client.api.config.OpcUaClientConfig; | |
import org.eclipse.milo.opcua.sdk.client.api.identity.AnonymousProvider; | |
import org.eclipse.milo.opcua.stack.client.UaTcpStackClient; |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am kevinherron on github. | |
* I am kevinherron (https://keybase.io/kevinherron) on keybase. | |
* I have a public key ASCm4aAA4vH81LGpEb1rJ-D99hl0sVWFBH27o9KmFxeV7Ao | |
To claim this, I am signing this object: |
This file contains hidden or 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 (c) 2017 Kevin Herron | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* and Eclipse Distribution License v1.0 which accompany this distribution. | |
* | |
* The Eclipse Public License is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* and the Eclipse Distribution License is available at |
This file contains hidden or 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
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.channels.* | |
import kotlinx.coroutines.delay | |
import java.time.Duration | |
import java.util.concurrent.TimeUnit | |
fun <T> ReceiveChannel<T>.debounce(timeout: Long, scope: CoroutineScope) = | |
this.debounce(Duration.ofMillis(timeout), scope) | |
fun <T> ReceiveChannel<T>.debounce( |
This file contains hidden or 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
import kotlinx.coroutines.* | |
fun main(args: Array<String>) { | |
val job = SupervisorJob() | |
val scope = CoroutineScope(job + Dispatchers.Default) | |
val deferred = GlobalScope.async(Dispatchers.Default, start = CoroutineStart.LAZY) { | |
delay(5000) | |
throw Exception("boom") |
This file contains hidden or 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 (c) 2019 the Eclipse Milo Authors | |
* | |
* This program and the accompanying materials are made | |
* available under the terms of the Eclipse Public License 2.0 | |
* which is available at https://www.eclipse.org/legal/epl-2.0/ | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
*/ |