Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Commits
0253bbef
Commit
0253bbef
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Refactor ServiceProcessor callback
parent
47414a4b
No related branches found
No related tags found
2 merge requests
!102
Release 1.0.0
,
!18
Update Bindings
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ElixxirDAppsSDK/Callbacks/ServiceProcessor.swift
+22
-10
22 additions, 10 deletions
Sources/ElixxirDAppsSDK/Callbacks/ServiceProcessor.swift
with
22 additions
and
10 deletions
Sources/ElixxirDAppsSDK/Callbacks/ServiceProcessor.swift
+
22
−
10
View file @
0253bbef
...
...
@@ -2,20 +2,27 @@ import Bindings
import
XCTestDynamicOverlay
public
struct
ServiceProcessor
{
public
typealias
Process
=
(
_
message
:
Data
,
_
receptionId
:
Data
,
_
ephemeralId
:
Int64
,
_
roundId
:
Int64
)
->
Void
public
init
(
serviceTag
:
String
,
process
:
@escaping
Process
)
{
public
struct
Callback
:
Equatable
{
public
init
(
message
:
Data
,
receptionId
:
Data
,
ephemeralId
:
Int64
,
roundId
:
Int64
)
{
self
.
message
=
message
self
.
receptionId
=
receptionId
self
.
ephemeralId
=
ephemeralId
self
.
roundId
=
roundId
}
public
var
message
:
Data
public
var
receptionId
:
Data
public
var
ephemeralId
:
Int64
public
var
roundId
:
Int64
}
public
init
(
serviceTag
:
String
,
process
:
@escaping
(
Callback
)
->
Void
)
{
self
.
serviceTag
=
serviceTag
self
.
process
=
process
}
public
var
serviceTag
:
String
public
var
process
:
Process
public
var
process
:
(
Callback
)
->
Void
}
extension
ServiceProcessor
{
...
...
@@ -41,7 +48,12 @@ extension ServiceProcessor {
guard
let
receptionId
=
receptionId
else
{
fatalError
(
"BindingsProcessor.process received `nil` receptionId"
)
}
serviceProcessor
.
process
(
message
,
receptionId
,
ephemeralId
,
roundId
)
serviceProcessor
.
process
(
Callback
(
message
:
message
,
receptionId
:
receptionId
,
ephemeralId
:
ephemeralId
,
roundId
:
roundId
))
}
func
string
()
->
String
{
...
...
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