mono

【Java】关于Mono与Flux

核能气质少年 提交于 2020-12-11 10:20:12
生产者(生产大米者) 消费者(买大米者) 出现供大于求的情况?该怎么办? 背压来了 背压可以控制生产者生产的速度 大白话理解 来源: oschina 链接: https://my.oschina.net/u/4318809/blog/4791370

微服务三大利器之限流

∥☆過路亽.° 提交于 2020-12-11 05:47:03
背景 随着微服务的流行,服务和服务之间的稳定性变得越来越重要。缓存、降级和限流是保护微服务系统运行稳定性的三大利器。 缓存:提升系统访问速度和增大系统能处理的容量 降级:当服务出问题或者影响到核心流程的性能则需要暂时屏蔽掉 限流:解决服务雪崩,级联服务发生阻塞时,及时熔断,防止请求堆积消耗占用系统的线程、IO等资源,造成其他级联服务所在服务器的崩溃 这里我们主要说一下限流,限流的目的应当是通过对并发访问/请求进行限速或者一个时间窗口内的的请求进行限速来保护系统,一旦达到限制速率就可以拒绝服务、等待、降级。 首先,我们需要去了解最基本的两种限流算法。 限流算法 漏桶算法 令牌桶算法 计算器算法 这里主要是提一下,详细了解限流算法请参考下面链接 https://www.cnblogs.com/hopeiscoming/p/12297528.html 限流框架 下面说一下现有流行的限流工具 guava Google的Guava工具包中就提供了一个限流工具类——RateLimiter。RateLimiter是基于“令牌通算法”来实现限流的。 hystrix hystrix主要是通过资源池以及信号量来限流,暂时能支持简单的限流 sentinel 限流比较主流的三种算法:漏桶,令牌桶,滑动窗口。而Sentinel采用的是最后一种,滑动窗口来实现限流的。当然sentinel不仅仅局限于限流

VB.net on Raspbian OS (Linux & Mono)

杀马特。学长 韩版系。学妹 提交于 2020-12-06 12:27:08
问题 So I installed mono-runtime and monodevelop on my RasberryPI running Raspbian. I also built a test application in vb.net which Is targeted for .net 2.0. When I try and run the test app I get this: Missing method CompareString in assembly /home/pi/Desktop/PITest.exe, type Microsoft.VisualBasic.CompilerServices.Operators Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

实战SpringCloud响应式微服务系列教程(第七章)

☆樱花仙子☆ 提交于 2020-12-05 07:53:30
本章节继续介绍:Flux和Mono操作符(二) 1.条件操作符 Reactor中常用的条件操作符有defaultIfRmpty、skipUntil、skipWhile、takeUntil和takeWhile等。 1、defaultIfRmpty defaultIfRmpty操作符返回来自原始数据流的元素,如果原始数据流中没有元素,则返回一个默认元素。 defaultIfRmpty操作符在实际开发过程中应用广泛,通常用在对方法返回值的处理上。如下controller层对service层返回值的处理。 @GetMapper("/article/{id}" ) public Mono<ResponseEntity<Article>> findById(@PathVariable String id){ return articleService.findOne(id) .map(ResponseEntity::ok) .defaultIfRmpty(ResponseEntity.status( 404).body( null )); } 2、takeUntil takeUntil操作符的基本用法是 takeUntil(Predicate<? super T>> predicate) ,其中Predicate代表一种断言条件,takeUntil将提取元素直到断言条件返回true。

Spring Data R2DBC快速上手指南

故事扮演 提交于 2020-11-30 13:45:14
关注 “Java艺术” 我们一起成长! R2DBC 基于 Reactive Streams 反应流规范,它是一个开放的规范,为驱动程序供应商和使用方提供接口( r2dbc-spi ),与 JDBC 的阻塞特性不同,它提供了完全反应式的非阻塞 API 与关系型数据库交互。 简单说, R2DBC 项目是支持使用反应式编程 API 访问关系型数据库的桥梁,定义统一接口规范,不同数据库厂家通过实现该规范提供驱动程序包。 R2DBC 定义了所有数据存储驱动程序必须实现的 SPI ,目前实现 R2DBC SPI 的驱动程序包括: r2dbc-h2 :为 H2 实现的驱动程序; r2dbc mariadb :为 Mariadb 实现的驱动程序; r2dbc mssql :为 Microsoft SQL Server 实现的本机驱动程序; r2dbc mysql :为 Mysql 实现的驱动程序; r2dbc postgres :为 PostgreSQL 实现的驱动程序; 同时, r2dbc 还提供反应式连接池r2dbc-pool( https://github.com/r2dbc/r2dbc-pool )。 本篇内容: 使用r2dbc-mysql驱动程序包与mysql数据库建立连接 使用r2dbc-pool获取数据库连接 Spring-Data-R2DBC增删改查API 事务的使用 R2DBC

CSC: error CS0041: Unexpected error writing debug information — 'Operation is not supported on this platform.'

南楼画角 提交于 2020-11-30 11:08:23
问题 Just downloaded Visual Studio Professional for Mac and I cannot seem to build anything as I always get the same error: /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) -> CSC: error CS0041: Unexpected error writing debug information -- 'Operation is not supported on this platform.' 19 Warning(s) 1 Error(s) Not sure what to change on my project to get things to compile. 回答1: I was able to work around this problem two ways:

CSC: error CS0041: Unexpected error writing debug information — 'Operation is not supported on this platform.'

你说的曾经没有我的故事 提交于 2020-11-30 11:04:55
问题 Just downloaded Visual Studio Professional for Mac and I cannot seem to build anything as I always get the same error: /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) -> CSC: error CS0041: Unexpected error writing debug information -- 'Operation is not supported on this platform.' 19 Warning(s) 1 Error(s) Not sure what to change on my project to get things to compile. 回答1: I was able to work around this problem two ways:

CSC: error CS0041: Unexpected error writing debug information — 'Operation is not supported on this platform.'

一世执手 提交于 2020-11-30 11:04:35
问题 Just downloaded Visual Studio Professional for Mac and I cannot seem to build anything as I always get the same error: /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) -> CSC: error CS0041: Unexpected error writing debug information -- 'Operation is not supported on this platform.' 19 Warning(s) 1 Error(s) Not sure what to change on my project to get things to compile. 回答1: I was able to work around this problem two ways:

CSC: error CS0041: Unexpected error writing debug information — 'Operation is not supported on this platform.'

本秂侑毒 提交于 2020-11-30 11:04:06
问题 Just downloaded Visual Studio Professional for Mac and I cannot seem to build anything as I always get the same error: /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) -> CSC: error CS0041: Unexpected error writing debug information -- 'Operation is not supported on this platform.' 19 Warning(s) 1 Error(s) Not sure what to change on my project to get things to compile. 回答1: I was able to work around this problem two ways:

AkShare-股票数据-两市停复牌

百般思念 提交于 2020-11-29 08:36:48
作者寄语 提供一个小接口,提供两市停复牌的数据,方便查询。 AkShare-更新记录 "stock_em_tfp" # 两市停复牌数据 股票 两市停复牌 接口: stock_em_tfp 目标地址: http://data.eastmoney.com/tfpxx/ 描述: 获取东方财富网-数据中心-特色数据-两市停复牌 限量: 单次获取指定交易日的停复牌数据 输入参数 名称 类型 必选 描述 trade_date str Y trade_date="2020-03-25" 输出参数 名称 类型 默认显示 描述 代码 str Y 名称 float Y 停牌时间 float Y 停牌截止时间 float Y 停牌期限 float Y 停牌原因 float Y 所属市场 float Y 预计复牌时间 float Y 接口示例 import akshare as ak stock_em_tfp_df = ak.stock_em_tfp(trade_date="2020-03-25") print(stock_em_tfp_df) 数据示例 代码 名称 停牌时间 ... 停牌原因 所属市场 预计复牌时间 0 600766 园城黄金 2020-03-11 09:30 ... 拟筹划重大资产重组 沪市A股 2020-03-25 1 200505 京粮B 2020-03-25 09:30 ...