Skip to content

Commit 3f95dbc

Browse files
committed
fix(moonzero): drop the raise annotations moonrpc 0.10.0 made unreachable.
Signed-off-by: Leo Cheng (heke1228) <chengkelfan@qq.com>
1 parent 409e8af commit 3f95dbc

4 files changed

Lines changed: 9 additions & 12 deletions

File tree

discovery.mbt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,7 @@ pub fn RpcCluster::add(
401401
///|
402402
/// Open a channel to the server bound at `endpoint`, or `None` if nothing is
403403
/// reachable there (a stale registry entry pointing at a gone instance).
404-
pub fn RpcCluster::dial(
405-
self : RpcCluster,
406-
endpoint : Endpoint,
407-
) -> RpcChannel? raise {
404+
pub fn RpcCluster::dial(self : RpcCluster, endpoint : Endpoint) -> RpcChannel? {
408405
match self.servers.get(endpoint.address()) {
409406
Some(server) =>
410407
Some(RpcChannel::connect(server, authority=endpoint.address()))
@@ -444,7 +441,7 @@ pub fn LoadBalancedChannel::new(
444441
/// no subchannel is ready.
445442
fn LoadBalancedChannel::pick_channel(
446443
self : LoadBalancedChannel,
447-
) -> Result[RpcChannel, @moonrpc.Status] raise {
444+
) -> Result[RpcChannel, @moonrpc.Status] {
448445
let endpoints = (self.resolve)(self.service)
449446
match self.balancer.pick(endpoints) {
450447
None => Err(@moonrpc.Status::Unavailable)

moon.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Lfan-ke/moonzero"
22

3-
version = "0.6.3"
3+
version = "0.7.1"
44

55
readme = "README.md"
66

@@ -22,6 +22,6 @@ description = "moonzero — a service framework for MoonBit (← go-zero): confi
2222
import {
2323
"Lfan-ke/moonapi@0.7.0",
2424
"Lfan-ke/moonasgi@0.8.0",
25-
"Lfan-ke/moonrpc@0.9.0",
25+
"Lfan-ke/moonrpc@0.10.0",
2626
"moonbitlang/async@0.20.3",
2727
}

pkg.generated.mbti

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,14 +778,14 @@ pub fn RpcChannel::call(Self, String, Bytes) -> Result[Bytes, @moonrpc.Status] r
778778
pub fn RpcChannel::call_bidi_streaming(Self, String, Array[Bytes]) -> Result[Array[Bytes], @moonrpc.Status] raise
779779
pub fn RpcChannel::call_client_streaming(Self, String, Array[Bytes]) -> Result[Bytes, @moonrpc.Status] raise
780780
pub fn RpcChannel::call_server_streaming(Self, String, Bytes) -> Result[Array[Bytes], @moonrpc.Status] raise
781-
pub fn RpcChannel::connect(RpcServer, authority? : String) -> Self raise
781+
pub fn RpcChannel::connect(RpcServer, authority? : String) -> Self
782782
pub fn RpcChannel::open_bidi(Self, String) -> BidiCall raise
783783

784784
pub struct RpcCluster {
785785
servers : Map[String, RpcServer]
786786
}
787787
pub fn RpcCluster::add(Self, Endpoint, RpcServer) -> Unit
788-
pub fn RpcCluster::dial(Self, Endpoint) -> RpcChannel? raise
788+
pub fn RpcCluster::dial(Self, Endpoint) -> RpcChannel?
789789
pub fn RpcCluster::new() -> Self
790790

791791
pub struct RpcGroup {

zrpc.mbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub struct RpcChannel {
115115
pub fn RpcChannel::connect(
116116
server : RpcServer,
117117
authority? : String = "localhost",
118-
) -> RpcChannel raise {
118+
) -> RpcChannel {
119119
let engine = server.to_h2()
120120
let ch = {
121121
engine,
@@ -375,7 +375,7 @@ fn drain_messages(body : Bytes) -> (Array[Bytes], Bytes) {
375375
fn RpcChannel::open(
376376
self : RpcChannel,
377377
path : String,
378-
) -> (Int, Array[@moonrpc.Frame]) raise {
378+
) -> (Int, Array[@moonrpc.Frame]) {
379379
let sid = self.next_stream_id
380380
self.next_stream_id = self.next_stream_id + 2
381381
let block = self.encoder.encode([
@@ -407,7 +407,7 @@ fn RpcChannel::feed_data(
407407
sid : Int,
408408
payload : Bytes,
409409
end : Bool,
410-
) -> Array[@moonrpc.Frame] raise {
410+
) -> Array[@moonrpc.Frame] {
411411
self.engine.feed(Data(stream_id=sid, data=payload, end_stream=end, padding=0))
412412
}
413413

0 commit comments

Comments
 (0)