Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
8d25dfcd
Commit
8d25dfcd
authored
Sep 19, 2022
by
Benjamin Wenger
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/project/Channels' into project/Channels
parents
9d01117d
44121c71
No related branches found
No related tags found
3 merge requests
!510
Release
,
!419
rewrote the health tracker to both consider if there are waiting rounds and...
,
!340
Project/channels
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/channels.go
+17
-13
17 additions, 13 deletions
bindings/channels.go
with
17 additions
and
13 deletions
bindings/channels.go
+
17
−
13
View file @
8d25dfcd
...
...
@@ -740,6 +740,10 @@ func (cm *ChannelsManager) RegisterReceiveHandler(messageType int,
return
cm
.
api
.
RegisterReceiveHandler
(
channels
.
MessageType
(
messageType
),
cb
)
}
////////////////////////////////////////////////////////////////////////////////
// Event Model Logic //
////////////////////////////////////////////////////////////////////////////////
// EventModel is an interface which an external party which uses the channels
// system passed an object which adheres to in order to get events on the channel.
type
EventModel
interface
{
...
...
@@ -770,9 +774,9 @@ type EventModel interface {
// - Lease is a number of nanoseconds that the message is valid for.
// - Status is the status of the message.
// Statuses will be enumerated as such:
// Sent
-
0
// Delivered
-
1
// Failed
-
2
// Sent
|
0
// Delivered
|
1
// Failed
|
2
ReceiveMessage
(
channelID
[]
byte
,
messageID
[]
byte
,
senderUsername
string
,
text
string
,
timestamp
int64
,
lease
int64
,
roundId
int64
,
status
int64
)
...
...
@@ -794,9 +798,9 @@ type EventModel interface {
// - Lease is a number of nanoseconds that the message is valid for.
// - Status is the status of the message.
// Statuses will be enumerated as such:
// Sent
-
0
// Delivered
-
1
// Failed
-
2
// Sent
|
0
// Delivered
|
1
// Failed
|
2
ReceiveReply
(
channelID
[]
byte
,
messageID
[]
byte
,
reactionTo
[]
byte
,
senderUsername
string
,
text
string
,
timestamp
int64
,
lease
int64
,
...
...
@@ -808,7 +812,7 @@ type EventModel interface {
// Messages may arrive our of order, so a reply in theory can arrive before
// the initial message, as a result it may be important to buffer reactions.
//
// Parameters:
//todo: enumerate all arguments
// Parameters:
// - ChannelID is the marshalled channel ID.
// - MessageID is the marshalled message ID of the received message.
// - reactionTo is the message ID for the message that received a reaction.
...
...
@@ -819,13 +823,13 @@ type EventModel interface {
// - Lease is a number of nanoseconds that the message is valid for.
// - Status is the status of the message.
// Statuses will be enumerated as such:
// Sent
-
0
// Delivered
-
1
// Failed
-
2
// Sent
|
0
// Delivered
|
1
// Failed
|
2
ReceiveReaction
(
channelID
[]
byte
,
messageID
[]
byte
,
reactionTo
[]
byte
,
senderUsername
string
,
reaction
string
,
timestamp
int64
,
lease
int64
,
round
int64
,
status
int64
)
round
Id
int64
,
status
int64
)
// UpdateSentStatus is called whenever the sent status of a message
// has changed.
...
...
@@ -849,8 +853,8 @@ type toEventModel struct {
em
EventModel
}
// NewEventModel is a constructor for a toEventModel. This will take in
the
//
passed
EventModel and wraps it.
// NewEventModel is a constructor for a toEventModel. This will take in
an
// EventModel and wraps it
around the toEventModel
.
func
NewEventModel
(
em
EventModel
)
*
toEventModel
{
return
&
toEventModel
{
em
:
em
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment