본문 바로가기

'there is no reactor running, must be called from the context of a Tokio 1.x runtime' async api call을 blocking(synchronous call)으로 처리하고 싶다면(제목의 에러가 발생한다면) 아래와 같은 방법을 사용해서 해결을 할 수가 있다. 다만, async->sync call로 바뀌니 app의 동작에 영향을 줄 수 있다는 점도 참고한다. use tokio::runtime::Runtime; fn main() -> Result { // Create the runtime let rt = Runtime::new()?; // Spawn the root task rt.block_on(async { // your async api call here }); } 소스 출처는 https://docs.rs/tokio/1.11.0/tokio/runtime/index.html tokio::..
Tauri + Svelte + Material UI (+ Dark theme) Prerequisites Windows os (not tested on macos or linux) rust environment https://www.rust-lang.org/tools/install node environment NVM for Windows (recommended) https://github.com/coreybutler/nvm-windows Create tauri app with svelte https://tauri.studio/en/docs/getting-started/intro Run below command yarn create tauri-app And you will see below logs: yarn create v1.22.10 [1/4] Resolving packages...
macOS의 terminal에서 code 명령어로 Visual Studio Code로 실행하기 윈도우는 기본으로 동작하는 사항인데 macOS는 동작하지 않아서 팁을 남깁니다. ~/.zshenv 파일을 열어 아래의 내용을 추가하면 터미널에서 작업하던 폴더에서 code . (현재 폴더를 작업 폴더로 하기)를 실행하면 작업하는 하는 폴더와 함께 vscode를 열 수 있습니다. alias code='open -a "Visual Studio Code"'
rust 에서 library, unit test 분리하기 rust에서 library를 분리하고 library code를 테스트하는 unit test를 분리하는 방법을 소개합니다. node.js나 java들과 크게 다르진 않는데, 초반에 셋업할 때 구조를 이해하지 못하면 한참 해맬수가 있어서 공유합니다 아래와 같은 간단한 절차로 진행하면 구조를 이해하는 데 도움이 될 겁니다. 먼저 app를 생성합니다. cargo new my_app app에서 사용한 library를 생성합니다. cd my_app cargo new --lib my_lib library의 unit test 코드를 my_lib/src/lib.rs안에 작성합니다. pub fn add(a: i32, b: i32) -> i32 { a + b } 그리고, 예제로 들어 있던 test code를 my_lib/t..
webview_flutter 사용해보기 + url로 이동하기 새 프로젝트를 만듭니다. flutter create webapp1 pubspec.yaml 을 아래와 같이 수정합니다. dependencies: webview_flutter: ^2.0.9 home.dart 를 추가하고, webview를 추가합니다. (예제는 webview_flutter 의 기본 sample에 주석 달은 부분을 추가했습니다. https://pub.dev/packages/webview_flutter/example) import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; class HomeWidget extends..
Flutter 최신버전(v1.27.0 dev) 빌드시 에러 발생시 해결방안 최근 dev channel의 flutter v1.27.0 에서 빌드하면 아래와 같은 에러가 발생했습니다. Running "flutter pub get" in (myapp) ... Because no versions of youtube_player_flutter match >7.0.0+7 =2.0.0-rc1
Azure DevOps CI(Continuous Integration)로 Flutter Desktop for Windows Application 자동 빌드하기 Azure DevOps는 github같은 git 저장소, 프로젝트 관리를 할 수 있게 해주는 서비스의 일종입니다. 이전에 VSTS(Visual Studio Team Services)라는 서비스에서 새롭게 개편된 서비스라고 할 수 있습니다. 최근에 들어서 사용하기 시작했는데, github, gitlab에 못지 않은 다양한 기능을 가지고 있어서 쓸만합니다. 이 Azure Devops에서 지원하는 CI를 사용해서 Flutter Desktop App을 빌드해보려고 합니다. CD(Continuous Deployment)도 가능할 것으로 보이는데, 이번 포스트에서는 다루지 않습니다. 시작하기 전에 몇가지 준비사항이 있습니다. Azure DevOps 계정이 있어야 한다. (free plan으로도 개인 reposito..
Deploy React Frontend App on Heroku Heroku가 PaaS형태의 서비스로 app의 코드만 올려서 서비스가 가능합니다. 이번 포스트에서는 create-react-app으로 만들어진 기본앱을 heroku에 올리는 방법을 소개합니다. 예제를 시작하기 전에 heroku 계정을 있어야 합니다. 여기서는 소개하지 않습니다. 1. app을 생성합니다. create-react-app my-frontend-app --template typescript 2. heroku에 app을 생성합니다. cd my-frontend-app heroku create my-frontend-app --buildpack https://github.com/mars/create-react-app-buildpack.git 3. static.json 을 추가합니다. { "root":..