Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
ed11f38b
Commit
ed11f38b
authored
May 07, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use MONITOR priority for subscribeMessages by default
parent
a1322076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/subscribeMessages.kt
...monMain/kotlin/net.mamoe.mirai/event/subscribeMessages.kt
+10
-10
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/subscribeMessages.kt
View file @
ed11f38b
...
@@ -39,7 +39,7 @@ typealias MessagePacketSubscribersBuilder = MessageSubscribersBuilder<MessageEve
...
@@ -39,7 +39,7 @@ typealias MessagePacketSubscribersBuilder = MessageSubscribersBuilder<MessageEve
fun
<
R
>
CoroutineScope
.
subscribeMessages
(
fun
<
R
>
CoroutineScope
.
subscribeMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
listeners
:
MessagePacketSubscribersBuilder
.()
->
R
listeners
:
MessagePacketSubscribersBuilder
.()
->
R
):
R
{
):
R
{
// contract 可帮助 IDE 进行类型推断. 无实际代码作用.
// contract 可帮助 IDE 进行类型推断. 无实际代码作用.
...
@@ -71,7 +71,7 @@ typealias GroupMessageSubscribersBuilder = MessageSubscribersBuilder<GroupMessag
...
@@ -71,7 +71,7 @@ typealias GroupMessageSubscribersBuilder = MessageSubscribersBuilder<GroupMessag
fun
<
R
>
CoroutineScope
.
subscribeGroupMessages
(
fun
<
R
>
CoroutineScope
.
subscribeGroupMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
listeners
:
GroupMessageSubscribersBuilder
.()
->
R
listeners
:
GroupMessageSubscribersBuilder
.()
->
R
):
R
{
):
R
{
contract
{
contract
{
...
@@ -97,7 +97,7 @@ typealias FriendMessageSubscribersBuilder = MessageSubscribersBuilder<FriendMess
...
@@ -97,7 +97,7 @@ typealias FriendMessageSubscribersBuilder = MessageSubscribersBuilder<FriendMess
fun
<
R
>
CoroutineScope
.
subscribeFriendMessages
(
fun
<
R
>
CoroutineScope
.
subscribeFriendMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
listeners
:
FriendMessageSubscribersBuilder
.()
->
R
listeners
:
FriendMessageSubscribersBuilder
.()
->
R
):
R
{
):
R
{
contract
{
contract
{
...
@@ -123,7 +123,7 @@ typealias TempMessageSubscribersBuilder = MessageSubscribersBuilder<TempMessageE
...
@@ -123,7 +123,7 @@ typealias TempMessageSubscribersBuilder = MessageSubscribersBuilder<TempMessageE
fun
<
R
>
CoroutineScope
.
subscribeTempMessages
(
fun
<
R
>
CoroutineScope
.
subscribeTempMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
listeners
:
TempMessageSubscribersBuilder
.()
->
R
listeners
:
TempMessageSubscribersBuilder
.()
->
R
):
R
{
):
R
{
contract
{
contract
{
...
@@ -147,7 +147,7 @@ fun <R> CoroutineScope.subscribeTempMessages(
...
@@ -147,7 +147,7 @@ fun <R> CoroutineScope.subscribeTempMessages(
fun
<
R
>
Bot
.
subscribeMessages
(
fun
<
R
>
Bot
.
subscribeMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
listeners
:
MessagePacketSubscribersBuilder
.()
->
R
listeners
:
MessagePacketSubscribersBuilder
.()
->
R
):
R
{
):
R
{
contract
{
contract
{
...
@@ -173,7 +173,7 @@ fun <R> Bot.subscribeMessages(
...
@@ -173,7 +173,7 @@ fun <R> Bot.subscribeMessages(
fun
<
R
>
Bot
.
subscribeGroupMessages
(
fun
<
R
>
Bot
.
subscribeGroupMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
listeners
:
GroupMessageSubscribersBuilder
.()
->
R
listeners
:
GroupMessageSubscribersBuilder
.()
->
R
):
R
{
):
R
{
contract
{
contract
{
...
@@ -197,7 +197,7 @@ fun <R> Bot.subscribeGroupMessages(
...
@@ -197,7 +197,7 @@ fun <R> Bot.subscribeGroupMessages(
fun
<
R
>
Bot
.
subscribeFriendMessages
(
fun
<
R
>
Bot
.
subscribeFriendMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
listeners
:
FriendMessageSubscribersBuilder
.()
->
R
listeners
:
FriendMessageSubscribersBuilder
.()
->
R
):
R
{
):
R
{
contract
{
contract
{
...
@@ -222,7 +222,7 @@ fun <R> Bot.subscribeFriendMessages(
...
@@ -222,7 +222,7 @@ fun <R> Bot.subscribeFriendMessages(
fun
<
R
>
Bot
.
subscribeTempMessages
(
fun
<
R
>
Bot
.
subscribeTempMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
listeners
:
TempMessageSubscribersBuilder
.()
->
R
listeners
:
TempMessageSubscribersBuilder
.()
->
R
):
R
{
):
R
{
contract
{
contract
{
...
@@ -252,7 +252,7 @@ fun <R> Bot.subscribeTempMessages(
...
@@ -252,7 +252,7 @@ fun <R> Bot.subscribeTempMessages(
inline
fun
<
reified
E
:
Event
>
CoroutineScope
.
incoming
(
inline
fun
<
reified
E
:
Event
>
CoroutineScope
.
incoming
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
capacity
:
Int
=
Channel
.
UNLIMITED
capacity
:
Int
=
Channel
.
UNLIMITED
):
ReceiveChannel
<
E
>
{
):
ReceiveChannel
<
E
>
{
return
Channel
<
E
>(
capacity
).
apply
{
return
Channel
<
E
>(
capacity
).
apply
{
...
@@ -281,7 +281,7 @@ inline fun <reified E : Event> CoroutineScope.incoming(
...
@@ -281,7 +281,7 @@ inline fun <reified E : Event> CoroutineScope.incoming(
inline
fun
<
reified
E
:
BotEvent
>
Bot
.
incoming
(
inline
fun
<
reified
E
:
BotEvent
>
Bot
.
incoming
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
concurrencyKind
:
Listener
.
ConcurrencyKind
=
Listener
.
ConcurrencyKind
.
CONCURRENT
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
NORMAL
,
priority
:
Listener
.
EventPriority
=
Listener
.
EventPriority
.
MONITOR
,
capacity
:
Int
=
Channel
.
UNLIMITED
capacity
:
Int
=
Channel
.
UNLIMITED
):
ReceiveChannel
<
E
>
{
):
ReceiveChannel
<
E
>
{
return
Channel
<
E
>(
capacity
).
apply
{
return
Channel
<
E
>(
capacity
).
apply
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment