FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
framework/examples/soa_client.php at master · gushou/framework · GitHub
gushou
/
framework
Public
forked from
whcyc2002/swoole_framework
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
framework
/
examples
/
soa_client.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (43 loc) · 1.58 KB
Breadcrumbs
framework
/
examples
/
soa_client.php
Copy path
File metadata and controls
45 lines (43 loc) · 1.58 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
define
(
'
DEBUG
'
,
'
on
'
);
define
(
"
WEBPATH
"
,
str_replace
(
"\\"
,
"
/
"
,
__DIR__
));
require
__DIR__
.
'
/../libs/lib_config.php
'
;
//require __DIR__ . '/../vendor/autoload.php';
$
cloud
=
new
Swoole
\
Client
\
SOA
;
//$cloud->setServer('task', array('10.232.41.141:9502'));
$
cloud
->
addServers
(
array
(
'
127.0.0.1:8888
'
));
$
s
=
microtime
(
true
);
$
ok
=
$
err
=
0
;
for
(
$
i
=
0
;
$
i
<
1
;
$
i
++)
{
// $s2 = microtime(true);
$
ret1
=
$
cloud
->
task
(
"
BL
\\
Test::test1
"
,
"
hello
{
$
i
}
_1
"
);
$
ret2
=
$
cloud
->
task
(
"
BL
\\
Test::test1
"
,
"
hello
{
$
i
}
_2
"
);
$
ret3
=
$
cloud
->
task
(
"
BL
\\
Test::test1
"
,
"
hello
{
$
i
}
_3
"
);
$
ret4
=
$
cloud
->
task
(
"
BL
\\
Test::test1
"
,
"
hello
{
$
i
}
_4
"
);
$
ret5
=
$
cloud
->
task
(
"
BL
\\
Test::test1
"
,
"
hello
{
$
i
}
_5
"
);
$
ret6
=
$
cloud
->
task
(
"
BL
\\
Test::test1
"
,
"
hello
{
$
i
}
_6
"
);
$
ret7
=
$
cloud
->
task
(
"
BL
\\
Test::test1
"
,
"
hello
{
$
i
}
_7
"
);
$
ret8
=
$
cloud
->
task
(
"
BL
\\
Test::test1
"
,
"
hello
{
$
i
}
_8
"
);
// echo "send " . (microtime(true) - $s2) * 1000, "\n";
$
n
=
$
cloud
->
wait
(
0.5
);
//500ms超时
//and $ret1->code == Mido\Cloud::OK and $ret2->code == Mido\Cloud::OK
//表示全部OK了
if
(
$
n
===
8
)
{
$
ok
++;
var_dump
(
$
ret1
->
data
,
$
ret2
->
data
);
}
else
{
echo
"
#
{
$
i
}
\t"
;
echo
$
ret1
->
code
.
'
|
'
.
$
ret2
->
code
.
'
|
'
.
$
ret3
->
code
.
'
|
'
.
$
ret4
->
code
.
'
|
'
.
$
ret5
->
code
.
'
|
'
.
$
ret6
->
code
.
'
|
'
.
$
ret7
->
code
.
'
|
'
.
$
ret8
->
code
.
'
|
'
.
"\n"
;
$
err
++;
exit
;
}
unset(
$
ret1
,
$
ret2
,
$
ret3
,
$
ret4
,
$
ret5
,
$
ret6
,
$
ret7
,
$
ret8
);
}
echo
"
fail=
$
err
.
\n"
;
echo
"
ok=
$
ok
.
\n"
;
echo
"
use
"
. (
microtime
(
true
) -
$
s
) *
1000
,
"\n"
;
unset(
$
cloud
,
$
ret1
,
$
ret2
);
Back
|
FazBrowse Home
|
New Git URL