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
358df51e
Commit
358df51e
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add ServiceProcessor
parent
5be84eb4
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/ServiceProcessor.swift
+54
-0
54 additions, 0 deletions
Sources/ElixxirDAppsSDK/ServiceProcessor.swift
with
54 additions
and
0 deletions
Sources/ElixxirDAppsSDK/ServiceProcessor.swift
0 → 100644
+
54
−
0
View file @
358df51e
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
)
{
self
.
serviceTag
=
serviceTag
self
.
process
=
process
}
public
var
serviceTag
:
String
public
var
process
:
Process
}
extension
ServiceProcessor
{
public
static
let
unimplemented
=
ServiceProcessor
(
serviceTag
:
"unimplemented"
,
process
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.process"
)
)
}
extension
ServiceProcessor
{
func
makeBindingsProcessor
()
->
BindingsProcessorProtocol
{
class
Processor
:
NSObject
,
BindingsProcessorProtocol
{
init
(
_
serviceProcessor
:
ServiceProcessor
)
{
self
.
serviceProcessor
=
serviceProcessor
}
let
serviceProcessor
:
ServiceProcessor
func
process
(
_
message
:
Data
?,
receptionId
:
Data
?,
ephemeralId
:
Int64
,
roundId
:
Int64
)
{
guard
let
message
=
message
else
{
fatalError
(
"BindingsProcessor.process received `nil` message"
)
}
guard
let
receptionId
=
receptionId
else
{
fatalError
(
"BindingsProcessor.process received `nil` receptionId"
)
}
serviceProcessor
.
process
(
message
,
receptionId
,
ephemeralId
,
roundId
)
}
func
string
()
->
String
{
serviceProcessor
.
serviceTag
}
}
return
Processor
(
self
)
}
}
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