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
import 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); |
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
import 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); |
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
import 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@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
import 'package:flutter/material.dart'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
static const String _title = 'Flutter Code Sample'; | |
@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
import 'package:flutter/material.dart'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
static const String _title = 'Flutter Code Sample'; | |
@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
// This concludes immediatlly, as expected | |
#[async_std::test] | |
async fn test_listerner_client() { | |
let addr = next_test_ip4(); | |
// setup listener | |
let listener = UtpListener::bind(addr).await.unwrap(); | |
// spawn a background task waiting for the connection | |
task::spawn(async move { listener.accept().await.unwrap() }); |
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] | |
name = "async-internal-spawn" | |
version = "0.1.0" | |
authors = ["Ryan James Spencer <spencer.ryanjames@gmail.com>"] | |
edition = "2018" | |
[dependencies.async-std] | |
version = '1.6.2' | |
features = ['unstable'] |
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
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::network::hyperdrive] Metadata audit: Ok(Audit { valid_blocks: 4, invalid_blocks: 0 }) | |
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::network::hyperdrive] Metadata len: 4 | |
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::network::hyperdrive] Content audit: Ok(Audit { valid_blocks: 1, invalid_blocks: 0 }) | |
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::network::hyperdrive] Content len: 1 | |
[2020-07-16T01:38:29Z DEBUG colmeia_hypercore::observer::event] Error count reached maximum penalty. Bailing. |
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
fn main() { | |
let client = hypercore_protocol::ProtocolBuilder::initiator().connect(tcp_stream); | |
let shared_client = Arc::new(async_std::sync::RwLock::new(client)); | |
let bg_client = shared_client.clone(); | |
let bg_task = task::spawn(async move { | |
while let Ok(e) = bg_client.write().await.loop_next().await { | |
dbg!(e); | |
} | |
}); |
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
pub fn with_discovery(&mut self, mechanisms: Vec<impl Stream<Item = SocketAddr>>) { | |
let stream = mechanisms | |
.into_iter() | |
.fold(stream::pending(), |init, item| init.merge(item)); | |
/// mismatched types | |
/// expected struct `async_std::stream::pending::Pending<_>` | |
/// found struct `async_std::stream::stream::merge::Merge<async_std::stream::pending::Pending<_>, impl Stream<Item = SocketAddr>>` | |
} |
NewerOlder